home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 025a / vpi1330b.zip / PART1.MAN < prev    next >
Text File  |  1991-12-25  |  206KB  |  6,534 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                                 VP-Info Level 1
  20.  
  21.                               Command and Function
  22.  
  23.                                 Reference Manual
  24.  
  25.  
  26.  
  27.  
  28.                     by Sidney L. Bursten and Bernard Melman
  29.  
  30.                                       for
  31.  
  32.                             Sub Rosa Publishing Inc.
  33.                                       and
  34.                                  Sub Rosa Corp.
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.      1992 Edition
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                                  The next best thing to knowing something
  56.                                  is knowing where to find it.
  57.  
  58.                                  - Dr. Samuel Johnson (1709-1784)
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.      First printing
  68.      January, 1992
  69.  
  70.  
  71.      Copyright (c) 1992 Sub Rosa Publishing Inc.
  72.                         Unit 34-1170 Sheppard Ave. West.
  73.                         Downsview, ON, Canada    M3K 2A3
  74.                              Phone: (416) 398-8414
  75.                              Fax:   (416) 398-8415
  76.  
  77.      Incorporating material previously published in
  78.           MAX and VP-Info manuals, Copyright (c)
  79.           1984, 1985, 1986, 1989, 1990, 1991 Sub Rosa International Inc.
  80.  
  81.      VP-Info Level 1 Copyright (c) 1984, 1985,
  82.           1986, 1987, 1988, 1989, 1990, 1991, 1991 Sub Rosa International Inc.
  83.  
  84.  
  85.      Trademarks:
  86.  
  87.      SR-Info is a trademark of Sub Rosa Publishing Inc.
  88.      dCOMP and MAX are trademarks of Sub Rosa Inc.
  89.      Sub Rosa Publishing Inc. is an authorized user of
  90.           the VP-Info trademark, a trademark of Paperback
  91.           Software International
  92.      dBASE, dBASE II, dBASE III, dBASE III+ and dBASE IV
  93.           are trademarks of Ashton-Tate
  94.      IBM is a trademark of IBM Corporation
  95.  
  96.      10 9 8 7 6 5 4 3 2 1
  97.  
  98.  
  99.  
  100.                                   INTRODUCTION
  101.  
  102.  
  103.  
  104.  
  105.           VP-Info was the first and, we believe, is still the best
  106.      compiled data base management language designed for IBM-compatible
  107.      DOS computers.
  108.  
  109.           VP-Info (which, for the balance of this manual, will be
  110.      called just Info when referring generally to all versions of the
  111.      language) shares many of the language features and keywords of the
  112.      popular dBASE family of languages, so dBASE users can learn it in a
  113.      matter of hours, but has many novel features resulting in very fast
  114.      program execution and much reduced programming time.
  115.  
  116.           If this is your first exposure to Info, you may wish to put this
  117.      manual aside for a while and take it for a "test drive" with the help
  118.      of the brief instructions in the file FASTART on the distribution
  119.      disk.  But don't forget to come back to the full manual to take
  120.      advantage of the full power and versatility of Info.
  121.  
  122.           This release of the language represents its fifth major revision
  123.      and enhancement since its original publication by Sub Rosa Inc. in
  124.      1984 under the name dCOMP.  Sub Rosa Inc. published a major upgrade
  125.      under the name MAX in 1985, which in turn was followed in 1986 by
  126.      Paperback Software International's publication of a major new version
  127.      of the language under its own name, VP-Info.
  128.  
  129.           Paperback issued a major upgrading in 1988 and a brand new
  130.      version (2.0) in 1989, followed by this enhanced new version by Sub
  131.      Rosa Publishing Inc. in 1990.
  132.  
  133.           Our goal at Sub Rosa Publishing Inc. is to provide you, the user,
  134.      with the finest database management tool . . . one that will continue
  135.      to grow in power and utility through the coming years.  You can help
  136.      us achieve this goal in various ways.
  137.  
  138.           First of all, Info is a rich language with many useful features.
  139.      To make many of these available to you, peruse this Command and
  140.      Function Reference Manual.  Whether you are using Info as an
  141.      interactive data base management tool or as a full programming
  142.      language, periodic rereading of this manual will enable you to get
  143.      more out of Info.
  144.  
  145.           A Reference Manual is like a dictionary and a grammar; it is not
  146.      meant for the first time user.  The complete VP-Info manual, provided 
  147.      to all registered users, includes not only the "dictionary" reference
  148.      section provided on disk with VP-Info Level 1, but a complete
  149.      tutorial and several appendixes as well.  This printed and bound manual
  150.      is a major benefit of registration!
  151.  
  152.  
  153.  
  154.           Second, we would like to hear from you.  Whether it is errors in
  155.      the program or the manual, or suggestions for improvements, write or
  156.      fax us, or direct comments to us through CompuServe or the conference
  157.      on your major public-access bulletin board.
  158.  
  159.           Third, fill out the VP-Info SOFTWARE LICENSE AGREEMENT
  160.      AND REGISTRATION provided to you (it's on your disk under the name
  161.      ORDER.DOC) and mail it in.  We are unable to provide technical
  162.      assistance and program updates to non-registered users.
  163.  
  164.           The language is available in several versions to meet the varying
  165.      needs of individuals, organizations and businesses:
  166.  
  167.           A.   VP-Info Level 1 is an excellent choice for many individuals,
  168.                corresponding to the original release of VP-Info by
  169.                Paperback Software International, but with many added
  170.                features, more power and complete upward compatibility with
  171.                our more powerful versions.
  172.  
  173.                     VP-Info Level 1 is widely available through users' groups                 and public bulletin boards as a "shareware" product, giving
  174.                you the opportunity to "try before you buy."  Users who decide
  175.                to upgrade from Level 1 to one of the other versions are
  176.                given full credit for registration fees paid toward their
  177.                purchase of VP-Info Professional or VP-Info Professional II,
  178.                in either the Single-User or Network Editions.
  179.  
  180.                     VP-Info Level 1 may be freely copied and distributed to
  181.                 others in the United States  Canada, Great Britain and
  182.                Australia only in its complete, unaltered, compressed form,
  183.                and provided that no fee (other than a nominal copying fee) is
  184.                charged, that no printed  manual is supplied with the disk(s),
  185.                and no representation is made that the recipient has any right
  186.                to use the software without registration for more than
  187.                evaluation purposes for a period limited to 60 days.
  188.  
  189.                     Those making use of Level 1 in commercial and other
  190.                serious environments are expected to register their copies,
  191.                thus entitling them to their own bound manuals and the
  192.                opportunity to get telephone support and consultations.
  193.  
  194.           B.   VP-Info Professional and VP-Info Professional II are enhanced
  195.                versions of the language, offering access to many more files,
  196.                more records, more features and more power.
  197.  
  198.                     These enhanced versions are not available as a "shareware"
  199.                product, and distribution of the software or manuals by
  200.                anyone except authorized VP-Info Professional Resellers is
  201.                strictly prohibited.  One registered copy is required for
  202.                each computer on which VP-Info Professional is run.
  203.  
  204.  
  205.  
  206.           C.   VP-Info Professional Network Edition and VP-Info Professional
  207.                II Network Edition are the full network and multi-user versions
  208.                of the language, conforming to the file-sharing and locking
  209.                conventions of Microsoft DOS, versions 3.1 and above, and
  210.                compatible with a host of DOS network products including
  211.                Novell Netware, LanTastic and Corvus ReadiNet.
  212.  
  213.                     Unlike most network applications software, the two
  214.                Network Editions come with a license for all users
  215.                on each server.  If a network includes multiple network
  216.                servers, one copy is required for each server.
  217.  
  218.           If you have any difficulty in meeting your objectives with Info,
  219.      we invite you to call on us for assistance.  All users registered with
  220.      Sub Rosa Publishing Inc. or Sub Rosa Corp. are entitled to obtain
  221.      technical support and consulting by telephone.  Consult your
  222.      Registration Certificate for hours, specific entitlements, and charges
  223.      for additional consultations.
  224.  
  225.           Please remember that Info is not an application program; it's
  226.      actually a rich and powerful computer language that makes looking
  227.      after your data a lot easier that available alternatives.  But putting
  228.      all this power into your hands does carry a price: mistakes can result
  229.      in loss of data or erroneous results.  Sub Rosa Corp. and Sub Rosa
  230.      Publishing Inc. assume no liability or responsibility for any damages
  231.      whatsoever (including, without limitation, damages for loss of
  232.      business profits, business interruption, loss of business information,
  233.      or other pecuniary loss) arising out of the use of or inability to use
  234.      this software.  Additional information is contained in the limited
  235.      warrantee attached to the license agreement provided to you.
  236.  
  237.           Users who are members of major public bulletin boards may find
  238.      their local BBS carries a conference dealing with Info.  Sub Rosa
  239.      regularly downloads questions from a number of BBS systems
  240.      and uploads answers, comments and suggestions.  Call our office for
  241.      assistance in locating an appropriate BBS.
  242.  
  243.           In addition, the best of our bulletin-board and other
  244.      correspondence, plus articles and program examples are published on
  245.      our semi-annual "VP-Info Diskozine", our magazine-on-a-disk.
  246.      Subscriptions are available from our office.
  247.  
  248.           We hope you will find Info useful and fun to use, and get years
  249.      of satisfaction from it.
  250.  
  251.                     Sidney L. Bursten and Bernard Melman
  252.      Sub Rosa Corp.                     Sub Rosa Publishing Inc.
  253.      1313 Fifth Street SE               Unit 34-1170 Sheppard Ave. West.
  254.      Minneapolis, MN  55414             Downsview, ON, Canada    M3K 2A3
  255.      Phone: (612) 379-3898              Phone: (416) 398-8414
  256.      Fax:   (612) 379-3899              Fax:   (416) 398-8415
  257.  
  258.  
  259.  
  260.  
  261.                                     TABLE OF CONTENTS
  262.  
  263.  
  264.  
  265.           SECTION 1. USING Info
  266.              1.1. Setting up Info
  267.              1.2. Conversational Info
  268.              1.3. Running Programs with Info
  269.              1.4. Compiling with Info
  270.              1.5. The Configuration File
  271.              1.6. The SET File
  272.  
  273.  
  274.           SECTION 2. Info FILES AND VARIABLES
  275.              2.1. Files
  276.              2.2. Selecting Data Files
  277.              2.3. Variables
  278.                 Memo Fields
  279.              2.4. Variable Look-Up Rules
  280.              2.5. Matrix Variables
  281.              2.6. System Variables
  282.                 Function keys
  283.                 :DATE and :TIME
  284.                 :PICTURE
  285.                 Other system variables
  286.  
  287.  
  288.           SECTION 3. Info FUNCTIONS
  289.              3.1. Constants
  290.              3.2. Operations
  291.              3.3. Relations
  292.              3.4. Functions
  293.              3.5. Expressions
  294.              3.6. Rules of Precedence
  295.  
  296.  
  297.           SECTION 4. Info COMMANDS
  298.              4.1. The Form of the Commands
  299.              4.2. Symbols
  300.              4.3. Command List
  301.      VP-Info Level 1 Reference Manual             Page 1  SECTION 1
  302.  
  303.  
  304.                     SECTION 1. USING VP-Info Level 1
  305.  
  306.  
  307.           Before you can start running VP-Info Level 1 (which, for the
  308.      balance of this manual, we'll call Info by itself), you should
  309.      familiarize yourself with some basic topics.  These are discussed in
  310.      this section, beginning with "what is a data base anyway?" and
  311.      continuing with getting Info into operation, and using Info without
  312.      and with programs.
  313.  
  314.           This sections also covers installation of Info on your computer,
  315.      and customizing the installation to meet your specific needs.
  316.  
  317.           Finally, some considerations for advanced users are discussed,
  318.      and the several different versions of Info are compared.
  319.      VP-Info Level 1 Reference Manual             Page 2        SECTION 1
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.                       1.1. Basic Concepts and Orientation
  331.  
  332.  
  333.           There are some basic concepts and vocabulary that are fundamental
  334.      to getting maximum results from using Info.
  335.  
  336.           These are discussed here, including records and fields, file
  337.      names and field names, your keyboard and the way we use and refer to
  338.      its various keys.
  339.  
  340.           Records and Fields.  Everybody keeps information on file cards.
  341.      Here is a 3x5 card kept on an employee in a small company:
  342.  
  343.               ┌───────────────────────────────────────────┬───┐
  344.               │ Name: Marek, Joe                          │ 1 │
  345.               │ Address: 231 River Drive                  └───┤
  346.               │          Broomsdale, MD                       │
  347.               │          02110                                │
  348.               │ Telephone number: 566-7012                    │
  349.               │ Married: Y                                    │
  350.               │ Salary: 25,800.00                             │
  351.               │ Year employed: 1981                           │
  352.               │ Department: Maintenance                       │
  353.               └───────────────────────────────────────────────┘
  354.  
  355.           Now learn some computer jargon: the electronic version of a
  356.      filing box (containing such cards) is called a data file; a card
  357.      itself is called a record.  The number in the upper-right corner of
  358.      the card identifies the card as card number 1.  The same way, records
  359.      are numbered by record number.
  360.  
  361.           A card has separate areas for the various pieces of information
  362.      you want to collect.  We call these areas fields.  Each field is
  363.      identified by its name.  In this example, for instance, "Department"
  364.      is a field name, while "Maintenance" is the contents of the field.
  365.  
  366.           You identify records by their number, fields by their names.  How
  367.      do you identify data files?  By their names, of course.  For instance,
  368.      all the cards of your employees could be sitting in a box labelled
  369.      "Employee Records."  Unfortunately, the name you can give to a data
  370.      file in your computer is rather restrictive: only 8 letters or numbers
  371.      can be used.  So EMPLOYEE will have to do; EMP1, EMP2 are also good
  372.  
  373.  
  374.  
  375.  
  376.  
  377.      Basic Concepts and Orientation          Basic Concepts and Orientation
  378.      VP-Info Level 1 Reference Manual             Page 3         SECTION 1
  379.  
  380.  
  381.      file names.  (Do not use COMP for the first four letters of a data or
  382.      index file name; Info is unable to open such a file.)
  383.  
  384.           A file is actually identified by its drive designation, its
  385.      directory, its file name,  and its extension.  For example, the full
  386.      designation of our employee file could be C:\DATA\EMPLOYEE.DBF.
  387.  
  388.           File names.  A file name can have at most 8 characters.  You can
  389.      use all the letters of the alphabet, the digits 0 to 9, and the
  390.      underscore character (_).  You can use both capital and lower-case
  391.      letters, but the lower-case letters will be replaced by their
  392.      upper-case version.
  393.  
  394.           The restrictions on a file name are imposed by the operating
  395.      system of your computer.  (Check your Operating System Manual.  In
  396.      this book it is assumed that you have a little familiarity with your
  397.      computer and operating system.  Specifically, you should know the
  398.      drive designations, the operating system prompt, the DIR command, and
  399.      how to handle floppy disks.)  It may allow you to use some other
  400.      characters as well.  However, you cannot go wrong following the rules
  401.      as they were stated above.
  402.  
  403.           Note that the blank (the character you get by pressing the
  404.      spacebar), some punctuation symbols (. , :) , and most special
  405.      characters (< > | + and so on) are always prohibited.  For instance,
  406.      you are never allowed to use as a file name two short words separated
  407.      by a blank, such as CAR NAME.
  408.  
  409.           The data file we mentioned before, EMPLOYEE, also has an
  410.      extension, "DBF".  When you type in the full name, the extension is
  411.      separated from the file name by a period, though when you see it
  412.      listed by DIR, the extension will be separated from the name by one or
  413.      more spaces.  The extension may have at most three characters; all
  414.      Info file extensions have exactly three letters.
  415.  
  416.           The extension DBF stands for Data Base File.  There are many
  417.      other file types used by Info.  The extension always reveals the type
  418.      of the Info file.  Most of the commands do not require the extension.
  419.      For instance, when you create a data file, Info adds the extension DBF
  420.      unless you provide another one specifically.
  421.  
  422.           When you use a data file, just give the file name (with or
  423.      without the drive designation), and Info adds the DBF extension to
  424.      look the file up.  As a rule, when Info asks for a file name, do not
  425.      bother to give the extension.
  426.  
  427.           Field names.  A field name has at most 10 characters (two more
  428.      than file names); you can use all the letters, the digits 0 to 9, the
  429.      colon (:), and the underline (_).  The first character must be a
  430.      letter.  Again, you can use lower-case letters, but Info will convert
  431.      them to upper case.  Just as for file names, blanks cannot be used.
  432.  
  433.  
  434.  
  435.  
  436.      Basic Concepts and Orientation          Basic Concepts and Orientation
  437.      VP-Info Level 1 Reference Manual             Page 4       SECTION 1
  438.  
  439.  
  440.  
  441.           You have just read the formal rules for file and field names.
  442.      The most important rule, however, is the following:
  443.  
  444.                Always use file names and field names that are easy to
  445.           remember, names that remind you of what is in the data file and
  446.           field.
  447.  
  448.           So FILE1, as a rule, is a bad name, EMPLOYEE is good.  NAME1ST is
  449.      good for first name (and so is FNAME), FIELD2 is bad.
  450.  
  451.           How do you test whether a file or a field name is good by this
  452.      rule?  If you do not have to look up the file and field names when you
  453.      use them, they were named well.  If you have to look the names up all
  454.      the time, use better names.
  455.  
  456.           Field Types.  In setting up the data file (our electronic 3x5
  457.      cards), we first chose a name for it: EMPLOYEE.  Next we choose the
  458.      field names.
  459.  
  460.           For the name (Marek, Joe), NAME is fine, but hard to handle.
  461.      Later, we may need reports in which the first name and the family name
  462.      are displayed differently. So we split up the name into two fields:
  463.      NAME for the family name and FNAME for the first name.
  464.  
  465.           The address is in three lines.  Since you cannot put three lines
  466.      in a field (and also to gain flexibility in reporting), we split the
  467.      address up into four fields: ADDR, CITY, STATE, and ZIP.
  468.  
  469.           Telephone number becomes TEL:NO; married can stay MARRIED; Salary
  470.      can stay SALARY; Department is too long, so use DEPT instead.
  471.      Finally, we shorten Year employed to YEAR:EMP. (Note that ":" or "_"
  472.      is used in place of the blank, which is not allowed.)
  473.  
  474.           The fields NAME, FNAME, ADDR, CITY, STATE, ZIP, TEL:NO, DEPT will
  475.      be filled with text; anything that can be typed can go into these
  476.      fields.  You tell this to Info by saying that the field type is
  477.      character, or the field is a character field.  The abbreviation for
  478.      character type is C.
  479.  
  480.           It is not enough to say that NAME is a character field; Info also
  481.      wants to know how many characters you want to allow in the field.
  482.      This number is called the width of the field.  For instance, if we
  483.      specify 15, that means that any text of up to 15 characters can be
  484.      typed into NAME.  We can always type less.  (Info will fill what is
  485.      left of the field with blanks.)
  486.  
  487.           It is not always easy to decide the width of a field.  What is
  488.      the longest family name we'll have to use?  Don't worry, we can make
  489.      changes later.
  490.  
  491.  
  492.  
  493.  
  494.  
  495.      Basic Concepts and Orientation          Basic Concepts and Orientation
  496.      VP-Info Level 1 Reference Manual             Page 5     SECTION 1
  497.  
  498.  
  499.  
  500.           In this example, we use the CREATE command (see Section 4.3):
  501.  
  502.      1>CREATE employee
  503.  
  504.      and enter the following:
  505.  
  506.      Field:         Type:          Width:
  507.  
  508.      NAME           C              15
  509.      FNAME          C              10
  510.      ADDR           C              20
  511.      CITY           C              20
  512.      STATE          C               2
  513.      ZIP            C               5
  514.      TEL:NO         C               8
  515.      DEPT           C              15
  516.  
  517.           SALARY and YEAR:EMP are numbers.  Of course, we could define them
  518.      as character fields, but then we could not do mathematical operations
  519.      on them.  Since they are, by their nature, numbers, it is more natural
  520.      to define them as such, so we define them as numeric fields, type N.
  521.  
  522.           The width of YEAR:EMP is 4; you also have to tell Info how many
  523.      digits are allowed after the decimal point; in this case there is no
  524.      decimal point, so we say 0.
  525.  
  526.           The width of SALARY should be 9 to take salaries over
  527.      $100,000.00.  When counting for the width, we count all the digits and
  528.      the decimal point.  You are not allowed to type in 120000.00 as
  529.      120,000.00, so we do not make room for the comma; the width of SALARY
  530.      is 9, with 2 decimals.
  531.  
  532.      Field:         Type:          Width:         Decimals:
  533.  
  534.      YEAR:EMP       N              4              0
  535.      SALARY         N              9              2
  536.  
  537.           Finally, there is the field MARRIED.  You could define it as a
  538.      character field of width 1.  If you do this, Info will accept any
  539.      character for MARRIED.  You can restrict the characters accepted to
  540.      "Y" (yes) "N" (no) by declaring MARRIED a logical field (L).  In fact,
  541.      you can use any of  "Y", "y", "T", or "t" for true, and any of "N",
  542.      "n", "F", or "f" for false.
  543.  
  544.           A logical field is always of width 1.
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.      Basic Concepts and Orientation          Basic Concepts and Orientation
  555.      VP-Info Level 1 Reference Manual             Page 6   SECTION 1
  556.  
  557.  
  558.  
  559.      Field:         Type:          Width:         Decimals:
  560.  
  561.      MARRIED        L              1
  562.  
  563.           The Keyboard.  The next step is to create the EMPLOYEE file.  But
  564.      before you do that, familiarize yourself with your keyboard (yours may
  565.      have more keys than this representation of the original standard IBM
  566.      PC keyboard, but all these keys are on your keyboard, and these are
  567.      the only ones you need for Info):
  568.  
  569.      ┌──┬──┐ ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬────╥───────┬───────┐
  570.      │F1│F2│ │Es│1 │2 │3 │4 │5 │6 │7 │8 │9 │0 │- │= │ <- ║NumLock│ Break │
  571.      ├──┼──┤ ├──┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴─┬──╫───┬───┼───┬───┤
  572.      │F3│F4│ │Tab│q │w │e │r │t │y │u │i │o │p │[ │]  │` ║Hom│Up │PgU│ - │
  573.      ├──┼──┤ ├───┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬──┴──╫───┼───┼───┼───┤
  574.      │F5│F6│ │Ctrl│a │s │d │f │g │h │j │k │l │; │' │ <─┘ ║<--│   │-->│   │
  575.      ├──┼──┤ ├──┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴┬─┴──┬──╫───┼───┼───┤   │
  576.      │F7│F8│ │\ │Sh│z │x │c │v │b │n │m │, │. │/ │Shft│* ║End│ Dn│PgD│ + │
  577.      ├──┼──┤ ├──┴┬─┴──┴──┴──┴──┴──┴──┴──┴──┴──┴┬─┴────┼──╨───┼───┴───┤   │
  578.      │F9│F0│ │Alt│          Space Bar          │CpsLck│ Ins  │  Del  │   │
  579.      └──┴──┘ └───┴─────────────────────────────┴──────┴──────┴───────┴───┘
  580.      Function            Typewriter Keyboard              Cursor Keypad &
  581.       Keys                                                 Numeric Keypad
  582.  
  583.           There are a few special keys you have to know.  <ENTER> refers to
  584.      the key usually called ENTER or RETURN, marked on some computers with
  585.      a hooked backarrow:  <─┘.  Some keyboards have both a RETURN and an
  586.      ENTER key; they are interchangeable.
  587.  
  588.           At the right is a set of keys called the numeric keypad and/or
  589.      the cursor keypad.  With the <Num Lock> key switched on or with the
  590.      <Shift> key depressed, these keys output numbers; otherwise they
  591.      control the cursor (the flashing rectangle that indicates where the
  592.      next character we press will appear on the screen) and other actions.
  593.  
  594.           The key <End> is used to indicate the end of a Info procedure,
  595.                such as APPEND, BROWSE, CREATE, EDIT, WRITE.
  596.  
  597.           The four arrow keys are referred to as <Up>, <Dn>, <Left>, and
  598.                <Right>.  They are used to move the cursor around the
  599.                screen.  The keys <Home>, <PgUp>, and <PgDn> are used for
  600.                some commands, such as EDIT, BROWSE, READ, and WRITE.
  601.  
  602.           The left arrow on your cursor pad, <Left>, should not be confused
  603.                with the fat back arrow,  <-,  at the top of the keyboard,
  604.                called <Backspace>. <Left> moves left without affecting the
  605.                characters under it, <Backspace> "swallows up" each
  606.                character it moves over.
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.      Basic Concepts and Orientation          Basic Concepts and Orientation
  614.      VP-Info Level 1 Reference Manual             Page 7     SECTION 1
  615.  
  616.  
  617.           The delete key <Del>, and the insert key <Ins>, are used to
  618.                delete and insert characters on the command line and during
  619.                data entry and editing.  Each time <Del> is pressed, one
  620.                character is removed at the cursor, and anything to the
  621.                right moves over to take its place.  The <Ins> key is a
  622.                "toggle," meaning that if insert mode is on, pressing <Ins>
  623.                turns it off, and vice versa.
  624.  
  625.           Your keyboard also has ten or more function keys at the left or
  626.      along the top; the ten marked <F1> to <F10> have pre-assigned roles
  627.      which can be changed by the user.
  628.  
  629.           The escape key, <Esc>, can be used to escape from a command.
  630.  
  631.           Sometime two keys have to be pressed at the same time.  Ctrl-W
  632.      means press the control key (marked as Ctrl) and the W key at the same
  633.      time (there is no harm done pressing the control key first).  Alt-F10
  634.      means press the <Alt> key and <F10> at the same time.
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.                               1.2. Setting up Info
  646.  
  647.  
  648.           To run Info, you need an IBM PC, XT, AT, or compatible MS-DOS
  649.      computer with two disk drives, at least 512K memory, and DOS 2.0 or
  650.      later.
  651.  
  652.           To use Info, you need the following files, all having a
  653.      three-or-four-character name indication which version it is for, and
  654.      an extension descriptive of its contents.
  655.  
  656.           A.   All required or optional files for Level 1 have the name VPI1
  657.  
  658.           B.   All those for VP-Info Professional have the name VPI
  659.  
  660.           C.   All those for all those for VP-Info Professional Network
  661.                Edition have the name VPIN (except for VPI.HLP)
  662.  
  663.           The extensions for these files are as follows:
  664.  
  665.           A.   The EXE file and the MSG file. Each version of Info has its
  666.                own set of matching executable and message files, both of
  667.  
  668.  
  669.  
  670.  
  671.  
  672.      Setting up Info                                        Setting up Info
  673.      VP-Info Level 1 Reference Manual             Page 8       SECTION 1
  674.  
  675.  
  676.                which must be in the same place, either in the current
  677.                directory or in any directory on the DOS PATH (see your DOS
  678.                manual for details on PATH).  Info cannot be run without
  679.                both of these files.
  680.  
  681.                     In addition, both files are internally matched, so that
  682.                an EXE of one version or date of issue cannot be run without
  683.                the MSG file generated for that version on the same day.
  684.  
  685.                     To avoid errors, there should not be more than one copy
  686.                of each of these files anywhere in your hard disk.
  687.  
  688.                     The EXE file may be renamed if you desire, but the MSG
  689.                and all the following files must retain both their name and
  690.                extension.
  691.  
  692.           B.   The HLP file.  Info has an excellent on-line help system
  693.                that can be run at any time you are in conversational
  694.                (interactive) mode.  It is optional; to run it, the HLP file
  695.                must be in the same directory as the MSG file.  If it is not
  696.                present, the HELP command does not work.
  697.  
  698.           C.   The CNF file. An optional configuration file generated by
  699.                the user.  This is a regular Info program file (uncompiled),
  700.                residing in the subdirectory where Info is executed.
  701.  
  702.                     It is typically used to invoke the SET flags to suit
  703.                your needs, to define the function keys and such system
  704.                variables as :COMPANY and :TITLE (see Section 2.6), and to
  705.                establish where Info can expect to find files outside the
  706.                current directors (see FILES ... ENDFILES structure in
  707.                Section 4.3).
  708.  
  709.           D.   The SET file.  (VP-Info Professional and VP-Info
  710.                Professional Network Edition only.)  An optional file that,
  711.                if used, must reside in the directory where VP-Info is
  712.                executed.  The SET file is discussed in detail in Section
  713.                1.6.
  714.  
  715.           E.   The SGN file.  (VP-Info Professional and VP-Info
  716.                Professional Network Edition only.)   An optional file
  717.                supplied with the system, providing an attractive sign-on
  718.                for the user each time VP-Info is executed.
  719.  
  720.                     The SGN file normally goes in the same directory as the
  721.                MSG file, but if you want it to be executed only in some
  722.                directories and not in others, you will have to put it in
  723.                each directory from which you want it executed, and make
  724.                sure it is not in any directory listed in the DOS PATH.
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.      Setting up Info                                        Setting up Info
  732.      VP-Info Level 1 Reference Manual             Page 9       SECTION 1
  733.  
  734.  
  735.           In addition, you must have a CONFIG.SYS file (in the root
  736.      directory of your boot disk, see the DOS Reference Manual) containing
  737.      the lines:
  738.  
  739.      FILES=20
  740.      BUFFERS=20
  741.  
  742.      If you are running VP-Info Professional under DOS 3.3 or above, you
  743.      may open as many as 65 files at the same time, provided the FILES=
  744.      command in both your CONFIG.SYS and the SET file is set that high.
  745.  
  746.  
  747.  
  748.  
  749.                             1.3. Conversational Info
  750.  
  751.  
  752.           After you start Info, you see the copyright notice, and the Info
  753.      prompt:
  754.  
  755.      1>
  756.  
  757.           This prompt is Info's way of asking: What now?  You can issue any
  758.      commands (as listed in Section 4.3) or you can write and run a Info
  759.      program.
  760.  
  761.           Conversational VP-Info Level 1 (also called interactive mode) is
  762.      the use of Info by directly entering commands instead of using
  763.      programs.
  764.  
  765.           Info has a number of features to help you along.  There are a few
  766.      hints to help you get into Info quickly.
  767.  
  768.           Type in a command line; pressing <ENTER> executes the command:
  769.  
  770.      1>DIR
  771.  
  772.           The command line can be fully edited.  Use the cursor keys
  773.      described in the keyboard section above, or the full list of editing
  774.      keys listed under the WRITE command in Section 4.3.
  775.  
  776.           If there is an error in the command, the command line is
  777.      redisplayed; the cursor is placed on the first word after the word
  778.      that is the likely cause of the trouble.  Use the editing keys to
  779.      change the command line; then press <ENTER> to try executing it again.
  780.  
  781.           There are 78 characters on the command line available for a
  782.      command.  If you type in a longer command line, these 78 characters
  783.      will act as a window, with some characters disappearing off the left
  784.      or right edge of the screen.  You always see 78 characters of the long
  785.      command line.
  786.  
  787.  
  788.  
  789.  
  790.      Conversational VP-Info                          Conversational VP-Info
  791.      VP-Info Level 1 Reference Manual             Page 10       SECTION 1
  792.  
  793.  
  794.  
  795.           Info stores away the last five command lines (up to 75 characters
  796.      each).  You can get the previous command line back by pressing <Up> or
  797.      Ctrl-E.  If you press the key twice, you get back the second last
  798.      command line, and so on.  You can execute the recalled command by
  799.      pressing <ENTER>; you can edit the command before executing it just as
  800.      though you had typed it yourself.
  801.  
  802.           Pressing a function key is the same as typing in a command line
  803.      or lines stored in a matching system variable.  For example, :F1
  804.      usually contains the string "HELP ", so pressing the <F1> key is
  805.      exactly the same as typing in "HELP " (see Section 2.6).
  806.  
  807.           Two special characters are used in defining the function keys:
  808.      semicolon (;) causes Info to issues an <ENTER> code and execute
  809.      everything already put into the command line, and the caret (^) stands
  810.      for "hold down the control key while pressing the next character in
  811.      the string".  Examples:
  812.  
  813.                <F2> usually contains "LIST STRU;", which means: enter the
  814.                          string LIST STRU into the command line and
  815.                          execute.  This command lists the structure of the
  816.                          selected data file
  817.                <F10> usually contains "EDIT;", which means: enter the
  818.                          string EDIT into the command line and execute.
  819.                          This command begins to edit the selected data file
  820.  
  821.            To redefine the function key <F7> to contain a string causing
  822.      Info to go to the nearest record after an unsuccessful FIND and
  823.      immediately start to edit that record:
  824.  
  825.      1>:F7='GOTO :near;edit;'
  826.  
  827.      (see Section 2.3 and the = and FIND commands in Section 4.3).  You may
  828.      also redefine a function key on the fly: if the command is already
  829.      typed in, just place your cursor at the end of the command line and
  830.      press Alt-F7 to capture everything to the left of the cursor into :F7.
  831.  
  832.           Short programs (with no loops) can be stored in the function
  833.      keys, and executed by pressing the function keys.
  834.  
  835.           The most important commands for a beginner becoming familiar with
  836.      Info are (see the alphabetical command reference in Section 4.3):
  837.  
  838.           CREATE    - create a new data file
  839.           MODIFY    - change the structure on an existing data file
  840.           APPEND    - add records to a data file
  841.           EDIT      - view and change fields in a data file
  842.           BROWSE    - view and change some fields in many records of a data
  843.                         file
  844.  
  845.  
  846.  
  847.  
  848.  
  849.      Conversational VP-Info                          Conversational VP-Info
  850.      VP-Info Level 1 Reference Manual             Page 11       SECTION 1
  851.  
  852.  
  853.           LOCATE FOR - goto a record that meets some condition
  854.           CONTINUE  - goto the next record that meets the same condition
  855.           LIST      - list the fields of all or some records in a data file
  856.           DISPLAY   - list the fields in the current record of a data file
  857.           COUNT     - count the records in a data file
  858.           SUM       - add up the values of a numeric field in a data file
  859.           SORT      - sort a data file into a new file with a new order
  860.           INDEX     - create a separate file that maintains the apparent
  861.                         order of a data file without sorting the file
  862.           FIND      - find a record in an indexed file by the value of its
  863.                         "key"
  864.           REPORT    - produce a formatted list of a data file with optional
  865.                         headings, subtotals, and totals
  866.           STATUS    - check what files are open, the setting of SET
  867.                         commands, and the value of memory variables
  868.           LIST STRUCTURE - check the structure of the current data file
  869.           WRITE     - create or edit a text file or program
  870.  
  871.           The forthcoming Sub Rosa Publishing Inc. manual Conversational
  872.      VP-Info Level 1 explains use of these commands and many of the
  873.      interactive features in greater detail.
  874.  
  875.  
  876.  
  877.  
  878.                         1.4. Running Programs with Info
  879.  
  880.  
  881.           When you see the operating system prompt (A> or C> for example),
  882.      you can run the Info program MENU by typing
  883.  
  884.      C>VPI menu
  885.  
  886.      (or SRI menu, or VPIN menu as the case may be).  Info will load itself
  887.      into memory, execute the CNF file if found, and then run MENU.
  888.  
  889.           From within Info, that is, when you see the Info 1> prompt (or
  890.      2>,...,10>), run a program with the DO command:
  891.  
  892.      1>DO menu
  893.  
  894.           In either case, Info will first look for a compiled program:
  895.      MENU.CPL; if it is found, Info will run it.  If there is no MENU.CPL,
  896.      Info will look for an uncompiled program, MENU.PRG, which it will
  897.      compile on-the-fly and immediately execute.  The program name may not
  898.      have an extension in the command line.
  899.  
  900.           There are two other types of program which can be run by Info:
  901.      standard EXE, COM, and BAT programs with the RUN command, and (in
  902.      VP-Info only) binary file (assembly language) programs with the CALL
  903.      command.  See RUN and CALL in the command reference section.
  904.  
  905.  
  906.  
  907.  
  908.      Running Programs                                      Running Programs
  909.      VP-Info Level 1 Reference Manual             Page 12       SECTION 1
  910.  
  911.  
  912.  
  913.  
  914.  
  915.                             1.5. Compiling with Info
  916.  
  917.  
  918.           There are two ways to compile a program.  The first is on the
  919.      command line itself:
  920.  
  921.      1>COMPILE menu
  922.  
  923.           Alternately, you can compile many programs in one step by
  924.      creating and running a program containing a set of COMPILE commands.
  925.      For example, PROJ.PRG may consist of the following commands:
  926.  
  927.      COMPILE prog1
  928.      COMPILE prog2
  929.      COMPILE prog3
  930.      CHAIN proj1
  931.  
  932.           Then
  933.  
  934.      1>DO proj
  935.  
  936.      will compile PROG1, PROG2, and PROG3, and immediately execute PROJ1.
  937.      (The command DO issued at the command line is equivalent to CHAIN;
  938.      inside a program, its meaning is different.)
  939.  
  940.  
  941.  
  942.  
  943.                     1.6. The Configuration and Setting Files
  944.  
  945.  
  946.           When Info is invoked, it first looks for some special files that
  947.      are used to customize its installation to meet the user's special
  948.      needs.
  949.  
  950.           The SET file.  VP-Info Professional and VP-Info Professional
  951.      Network Edition allow a settings file with the extension SET, used by
  952.      Info primarily to allocate memory during loading.  The five commands
  953.      supported by the SET file permit the user to:
  954.  
  955.                1.   Set the maximum amount of memory to be used by VP-Info
  956.                     (see MEMORY= command in Section 4.3)
  957.  
  958.                2.   Set the maximum amount of memory to be allocated for
  959.                     loading binary files (assembly-language routines) that
  960.                     can be executed from within VP-Info (see BINSPACE=
  961.                     command in Section 4.3)
  962.  
  963.  
  964.  
  965.  
  966.  
  967.      Configuration File                                  Configuration File
  968.      VP-Info Level 1 Reference Manual             Page 13       SECTION 1
  969.  
  970.  
  971.  
  972.                3.   Set the maximum number of files that can be opened at
  973.                     one time by VP-Info (see the FILES= command in
  974.                     Section 4.3)
  975.  
  976.                4.   Set the maximum number of fields there can be in all
  977.                     data files opened at any one time (see FIELDS= command
  978.                     in Section 4.3)
  979.  
  980.                5.   Suppress special screen and sound effects accessed
  981.                     through the SCREEN, SOUND and RING commands (see
  982.                     NOEFFECTS command in Section 4.3)
  983.  
  984.           The SET file is completely optional, but users of certain
  985.      computers not 100% compatible with the IBM AT, or using certain
  986.      operating systems, may find it necessary to suppress the special
  987.      effects with the NOEFFECTS command.  See NOEFFECTS in the command
  988.      reference section of this manual for more details.
  989.  
  990.           Level 1 does not support binary programs or the special screen
  991.      and sound effects, and uses default settings for all the other
  992.      commands used in the SET files of VP-Info Professional and VP-Info
  993.      Professional Network Edition.  No SET file is used with Level 1.
  994.  
  995.           The CNF file.  Level 1 and all other versions of VP-Info allow a
  996.      configuration file with the extension CNF.  The CNF file is a regular
  997.      Info program file (uncompiled), residing in the subdirectory where
  998.      Info is executed.
  999.  
  1000.           The CNF file is completely optional, but it is extremely useful
  1001.      to define the SET flags to suit your needs, to define the function
  1002.      keys and such system variables as :COMPANY and :TITLE (see Section
  1003.      2.6), and to establish where Info can expect to find files outside the
  1004.      current directors (see FILES ... ENDFILES structure in Section 4.3).
  1005.  
  1006.           Any command can be used in the CNF file, but since it is compiled
  1007.      anew every time you enter Info, it should be kept as short as
  1008.      possible.
  1009.  
  1010.           If the last line of the file is a CHAIN command, the program
  1011.      chained to will be executed immediately, even if the DOS command that
  1012.      started Info names another program (see Section 1.4).
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.      Configuration File                                  Configuration File
  1027.      VP-Info Level 1 Reference Manual             Page 14       SECTION 1
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.                   1.7. Some Considerations For Advanced Users
  1034.  
  1035.  
  1036.           How to have different versions of Info coexist with one another.
  1037.      There are actually several different situations, all of which have to
  1038.      be discussed separately:
  1039.  
  1040.           A.   Running two or more of the following -- Level 1, VP-Info
  1041.                Professional, and  VP-Info Professional Network Edition --
  1042.                on the same computer:
  1043.  
  1044.                1.   If no two versions access the same data or programs,
  1045.                     there is no problem.  Just load all of the appropriate
  1046.                     files into the proper directories as shown in
  1047.                     Section 1.2.
  1048.  
  1049.                2.   If no network is involved, and the same programs are to
  1050.                     be executed two or more different versions of the
  1051.                     above, it is only necessary to provide a different
  1052.                     directory for each version's CPL files, and use the
  1053.                     FILES ... ENDFILES structure in each version's CNF file
  1054.                     to direct Info to the correct set of compiled programs.
  1055.  
  1056.                          If programs for the different versions are not
  1057.                     limited to the commands and functions available to the
  1058.                     lowest-power version, separate directories for the
  1059.                     programs may also be necessary.
  1060.  
  1061.                3.   There is no safe way to allow single-user versions to
  1062.                     operate in a network environment; do not try it except
  1063.                     in a completely private directory, and do not access
  1064.                     any files of any type which may also be accessed by
  1065.                     VP-Info Professional Network Edition.
  1066.  
  1067.           B.   Running VP-Info Version 1 together with one or more of the
  1068.                following -- VP-Info Level 1, VP-Info Professional, and VP-Info
  1069.                Professional Network Edition -- on the same computer:
  1070.  
  1071.                1.   The only files compatible between Version 1 and the
  1072.                     current versions are text files and libraries, report
  1073.                     form files, and data files.  All other files must be
  1074.                     segregated into separate directories for each version
  1075.                     if they are to be shared by the two versions.
  1076.  
  1077.                2.   Running Version 1 and VP-Info Professional is more
  1078.                     difficult than other combinations, since the main file
  1079.                     name is the same in both cases, VPI.EXE, and both look
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.      For Advanced Users                                  For Advanced Users
  1086.      VP-Info Level 1 Reference Manual             Page 15       SECTION 1
  1087.  
  1088.  
  1089.                     for VPI.CNF.  Therefore, these two versions must be
  1090.                     started in separate directories, and access to the
  1091.                     shared files coordinated through the FILES ... ENDFILES
  1092.                     structures in their respective CNF files.
  1093.  
  1094.           C.   Networking under Version 1 and VP-Info Professional Network
  1095.                Edition is incompatible and can cause catastrophic failure
  1096.                and data corruption if an attempt is made to share data
  1097.                files between them.
  1098.  
  1099.           Differences between the various versions of the language.  There
  1100.      are five versions to consider; in increasing level of power they are:
  1101.  
  1102.           A.   VP-Info Version 1.  Main technical specifications:
  1103.  
  1104.                Maximum 65,536 records in a data file
  1105.                Maximum 6 open data files
  1106.                Maximum 20 files open at one time, including DOS files
  1107.                Index structure incompatible with other four versions
  1108.                Included network facilities
  1109.                Temporary files (those with extension starting with $)
  1110.                     cannot be redirected with FILES ... ENDFILES structure
  1111.                     to ramdisk or disk with more space
  1112.                Expression lists could be separated either by commas or
  1113.                     spaces in many commands; now only commas are allowed
  1114.                Following functions substantially modified or not carried
  1115.                     forward to newer versions:
  1116.                        CONVERT(    split into two new functions, CTONUM(
  1117.                                      and NUMTOC(
  1118.                        DBF(        split into DBF( and FLD(
  1119.                        DIR(        split into DIR( and DIRX(
  1120.                Following commands substantially modified or not carried
  1121.                     forward to new versions:
  1122.                        :TERMINAL=  terminals no longer supported
  1123.                        SET ANSI    no longer supported
  1124.                        SET COLON   now use SET DELIMITER
  1125.                        SET FIELDS  now use FIELD= in SET file
  1126.                        SET MEMORY  now use MEMORY= in SET file
  1127.  
  1128.           B.   VP-Info Level 1 (previously distributed as SR-Info):
  1129.  
  1130.                Same number of files and records as Version 1
  1131.                Creates index files compatible with products C, D and E
  1132.                No network facilities
  1133.                EDIT allows appending records, and APPEND allows editing
  1134.                     existing records
  1135.                EDIT and BROWSE allow editing with a user-designed screen,
  1136.                     even from command line
  1137.                INDEX FROM allows a new index file, with same or different
  1138.                     name, to be created using expression of existing Info,
  1139.                     dBASE or Clipper index file
  1140.  
  1141.  
  1142.  
  1143.  
  1144.      For Advanced Users                                  For Advanced Users
  1145.      VP-Info Level 1 Reference Manual             Page 16       SECTION 1
  1146.  
  1147.  
  1148.                New scanning commands: MAXIMUM, MINIMUM
  1149.                Other new commands include:
  1150.                        LIMIT
  1151.                        SET CARRY
  1152.                        SET DIR
  1153.                        SET HEADING
  1154.                new functions implemented include:
  1155.  
  1156.                        ASC(
  1157.                        AT(
  1158.                        DELETED(
  1159.                        EOF(
  1160.                        IFF(
  1161.                        MAX(
  1162.                        MENU(
  1163.                        MIN(
  1164.                        NUMTOC(
  1165.                        SUBSTR(
  1166.                        UPPER(
  1167.                Some advanced functions, commands and options present in C,
  1168.                     D and E are not implemented in this version
  1169.  
  1170.           C.   VP-Info Version 2.  All features of VP-Info Level 1 plus:
  1171.  
  1172.                Unlimited number of records
  1173.                Maximum index size 32Mb; large enough for over 1,000,000
  1174.                     records with 15-character key
  1175.                Up to 10 data files open at one time
  1176.                EDIT and BROWSE allow editing with both a user-designed
  1177.                     screen and an ON FIELDS structure in programs
  1178.                SET file gives user control over how Info is loaded into
  1179.                     memory, including:
  1180.                        Up to 65 files open at one time
  1181.                        Up to 1000 fields in all data files open at one time
  1182.                        Special screen and sound effects implemented
  1183.                        Loading and running binary programs
  1184.                New commands implemented include:
  1185.                        New FIND variants: NEAREST, LAST, SEEK
  1186.                        MAXIMUM
  1187.                        MINIMUM
  1188.                        SET DIVZERO
  1189.                New functions implemented include:
  1190.                        CTONUM(
  1191.                        DBFX(
  1192.                        DIRX(
  1193.                        NDX(
  1194.                        RAND(
  1195.                        RECNO(
  1196.  
  1197.           D.   VP-Info Professional
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.      For Advanced Users                                  For Advanced Users
  1204.      VP-Info Level 1 Reference Manual             Page 16.1       SECTION 1
  1205.  
  1206.  
  1207.                Allow even larger index files
  1208.                New command:
  1209.                        OVERWRITE to
  1210.                New function:
  1211.                        IFKEY(
  1212.  
  1213.           E.   VP-Info Professional Network Edition
  1214.                Full support for DOS 3.1 and above network facilities,
  1215.                     including data and index files opened in LOCK, WRITE,
  1216.                     SHARE, and READ modes
  1217.                FILES and FILES ... ENDFILES structure enhanced to support
  1218.                     file modes and well as file redirection
  1219.                Commands implemented include:
  1220.                        LOCK
  1221.                        LOCK INDEXES
  1222.                        SET LOCK
  1223.                        SET NETWORK
  1224.                        UNLOCK
  1225.                        UNLOCK INDEXES                  SECTION 2. VP-Info Level 1 FILES AND VARIABLES
  1226.  
  1227.  
  1228.  
  1229.           In Conversational VP-Info Level 1 (interactive) and in
  1230.      VP-Info Level 1 programming, you deal with various file and variable
  1231.      types.  These are discussed in this section.
  1232.  
  1233.  
  1234.  
  1235.                                    2.1. Files
  1236.  
  1237.  
  1238.           VP-Info Level 1 uses different types of files; the type of the
  1239.      file is shown by the extension of the file name (this is the default
  1240.      extension; the commands allow the user to change the extensions with
  1241.      two exceptions: PRG and CPL).
  1242.  
  1243.           Data files (also called the database files) contain the data of
  1244.      the database.  The default extension is DBF.  Data files are created
  1245.      with the COPY, CREATE, and COPY STRUCTURE TO commands.  (See also
  1246.      MODIFY.)
  1247.  
  1248.           A data file contains a header describing the structure of the
  1249.      data file: the number of records, the number of fields in a record,
  1250.      and a description of each field (name, type, width, and for numerical
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.      Files                          VPI  VPIN                         Files           VP-Info Level 1 Reference Manual         Page 17        SECTION 2
  1257.  
  1258.  
  1259.      fields, the number of decimals).  The header is followed by the
  1260.      records.
  1261.  
  1262.           There are three types of data files used by VP-Info Level 1: Type
  1263.      1, Type 2, and Type 3.  From the user's point of view, it very seldom
  1264.      matters which type is used, and the type is "transparent."
  1265.  
  1266.           Type 1 data files can have up to 256 fields per record.  The size
  1267.      of the header is commensurate with the number of fields.  To create
  1268.      and use such data files, the SET FIELDS TO command has to be used.
  1269.  
  1270.           Type 2 data files are restricted to 32 fields per record.  The
  1271.      size of the header is fixed, it does not depend on the number of
  1272.      fields actually used.  Type 2 data files are identical with dBASE II
  1273.      data files.
  1274.  
  1275.           Type 3 data files can have up to 300 fields per record.  The size
  1276.      of the header is commensurate with the number of fields (but much
  1277.      larger than the header of a Type 1 data file with the same number of
  1278.      fields.  Type 3 data files are identical with dBASE III and IV data
  1279.      files without memo fields, although VP-Info permits more fields in a
  1280.      file than dBASE.
  1281.  
  1282.           The command CREATE can create data files of Types I and 2,
  1283.      although the default is Type 3.  The type can be changed in MODIFY,
  1284.      but the default is to leave type unchanged.  All commands can use data
  1285.      files of all three types.
  1286.  
  1287.           Index files are used to facilitate rapid access to the data in
  1288.      data files in a predetermined order for processing and reporting.  The
  1289.      default extension is NDX.  Index files are created with the INDEX
  1290.      command.
  1291.  
  1292.           Program files contain the programs.  There are two kinds: the
  1293.      source program (a text file with VP-Info Level 1 commands as text)
  1294.      with extension PRG and compiled program with extension CPL.  These
  1295.      extensions are compulsory!  (There is one exception, the CNF
  1296.      configuration file; see Section 1.5.)
  1297.  
  1298.           Report form files contain the specifications of a report.  The
  1299.      default extension is FRM.  These files are used by the REPORT command.
  1300.  
  1301.           Memory variable files contain the memory variables saved by the
  1302.      SAVE TO command.  The default extension is MEM.
  1303.  
  1304.           Sequential files (also called text files) contain "lines"; the
  1305.      end of line is marked by carriage return (ASCII code 13) and line feed
  1306.      (ASCII code 10).  A line can contain at most 254 characters.  The end
  1307.      of the file is marked by EOF (26).
  1308.  
  1309.           A set of functions -- ROPEN(, WOPEN(, READ(, WRITE(, IN(, OUT(,
  1310.      SSEEK(, and CLOSE( -- is provided to create, read, and write
  1311.  
  1312.  
  1313.  
  1314.  
  1315.      Files                          VPI  VPIN                         Files           VP-Info Level 1 Reference Manual         Page 18        SECTION 2
  1316.  
  1317.  
  1318.      sequential files in VP-Info Level 1 programs  Most word processors
  1319.      create (or have an option to create) sequential files.  Such files can
  1320.      then be utilized by VP-Info Level 1 programs.
  1321.  
  1322.           The WRITE command of VP-Info Level 1 creates and edits sequential
  1323.      files.  Since it is used primarily to work with program files, the
  1324.      default extension is PRG.
  1325.  
  1326.           There are text files with default extension TXT used by the SET
  1327.      ALTERNATE TO <file> command.
  1328.  
  1329.           Finally, VP-Info Level 1 can manipulate arbitrary DOS files with
  1330.      another set of functions -- ROPEN(, WOPEN(, GET(, PUT(, SEEK(, and
  1331.      CLOSE(.  A typical application of the use of DOS files is the
  1332.      conversion of a data file from one type to another.
  1333.  
  1334.           File names are requested by <file> in the command descriptions.
  1335.      <file> is the file name, usually, without extension.  If no extension
  1336.      is given, then the default extension is added by VP-Info Level 1.
  1337.      However, if the user types in an extension, this overrules the
  1338.      VP-Info Level 1 default extension (exceptions: PRG, CPL, and CNF are
  1339.      compulsory).
  1340.  
  1341.           The file name has to follow the rules set out by the operating
  1342.      system: there are at most 8 characters in a file name.  You cannot go
  1343.      wrong if the first character is a letter and the other characters are
  1344.      letters and numbers; spaces are never permitted.
  1345.  
  1346.           DOS devices include such names as PRN, CON, AUX, LPT1, COM2, etc.
  1347.      Any sequential or arbitrary file function, and most of the copy and
  1348.      spool commands, allow you to specify either an actual file or a
  1349.      device.
  1350.  
  1351.           Technically, input/output involving files is buffered, while
  1352.      input/output involving devices is not.  In VP-Info Level 1 you may
  1353.      choose to treat any device as either buffered or unbuffered, merely by
  1354.      adding a colon to the end of the name to have DOS treat it as an
  1355.      unbuffered device, and without a colon to designate a buffered file.
  1356.  
  1357.           In most cases it makes little difference how you treat a device;
  1358.      rules for when one technique is better than another is outside the
  1359.      scope of this manual.
  1360.  
  1361.           See your DOS manual for a complete list of DOS device names.
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.      Files                          VPI  VPIN                         Files           VP-Info Level 1 Reference Manual         Page 19        SECTION 2
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.                            2.2. Selecting Data Files
  1381.  
  1382.  
  1383.           Level 1 can use up to 6 data files at the same time, while both
  1384.      VP-Info Professional and VP-Info Professional Network Edition can use
  1385.      up to 10 at a time.  Each data file used is assigned a file number by
  1386.      which the data file can be referenced.  File number may be assigned in
  1387.      an arbitrary manner, subject to the cautions contained in Appendix A.
  1388.  
  1389.           Before activating a file, select a file number with the SELECT
  1390.      command.  To activate the first file as the data file CUST, and third
  1391.      file as the data file TRANS:
  1392.  
  1393.      1>SELECT 1
  1394.      1>USE cust
  1395.      1>SELECT 3
  1396.      3>USE trans
  1397.  
  1398.      Note how the VP-Info Level 1 prompt shows the file number selected.
  1399.  
  1400.           There are three ways to indicate which file in use is referenced:
  1401.  
  1402.           a. Choose the file number.  The choice remains in effect until
  1403.      otherwise specified.  This is done with the SELECT command.
  1404.  
  1405.      1>SELECT 2
  1406.  
  1407.      selects file 2.  All commands refer to it, all field names are checked
  1408.      in it.
  1409.  
  1410.           b. Choose a file number for one command only.  This is done by
  1411.      following the first word of the command by # and the file number.  For
  1412.      instance,
  1413.  
  1414.      1>LIST#2
  1415.  
  1416.      lists file 2, regardless of which one is presently selected.  (Note:
  1417.      there is no space before or after the # sign.)  Even if the command
  1418.      requires two or more words (e.g., COPY STRUCTURE TO), the first-word
  1419.      rule applies: COPY#2 STRUCTURE TO temp.
  1420.  
  1421.           This technique, called command redirection, can even be used to
  1422.      open the data files themselves, as follows:
  1423.  
  1424.      1>USE#1 cust
  1425.      1>USE#2 inven
  1426.      1>USE#3 trans
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.      Selecting Data Files           VPI  VPIN          Selecting Data Files           VP-Info Level 1 Reference Manual         Page 20        SECTION 2
  1434.  
  1435.  
  1436.           c. Refer to one field in a file.  This is done by field
  1437.      redirection, following the field with # and the file number.  For
  1438.      instance,
  1439.  
  1440.      DAVID#4
  1441.  
  1442.      refers to the field DAVID in file 4.
  1443.  
  1444.           In this manual, "the selected file" refers to the data file
  1445.      currently selected.  In the last series of commands, at the start,
  1446.      CUST is the selected file.  After the command:
  1447.  
  1448.      1>SELECT 3
  1449.  
  1450.      TRANS is the selected file.  Note that a SELECT command only selects a
  1451.      new file number; there may be no file used under that file number.
  1452.  
  1453.  
  1454.  
  1455.                                  2.3. Variables
  1456.  
  1457.  
  1458.           A VP-Info Level 1 variable is a storage area in which changing
  1459.      values can be stored.  If the storage is in a data file, the variable
  1460.      is called a field; if the storage is temporary, in the memory only,
  1461.      the variable is called a memory variable.
  1462.  
  1463.           VP-Info Level 1 also has a special type of variable called a
  1464.      system variable, including the contents of the ten function keys, date
  1465.      and time, default report title, and so on.  System variables are
  1466.      discussed in Section 2.6.  The name of a system variable starts with a
  1467.      colon.
  1468.  
  1469.           There can be only 128 active memory variables.  Since any one of
  1470.      these can be a matrix variable (see Section 2.5), only the available
  1471.      memory limits the number of memory variables.
  1472.  
  1473.           A variable is identified by its name.  A name is 1 to 10
  1474.      characters long; the first character must be a letter; the other
  1475.      characters are letters (converted to upper case), digits, :, and _
  1476.      (underline).
  1477.  
  1478.           Here are some examples of valid variable names:
  1479.  
  1480.      cost
  1481.      cost2
  1482.      m:cost
  1483.      first_name
  1484.  
  1485.           But note:
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.      Variables                      VPI  VPIN                     Variables           VP-Info Level 1 Reference Manual         Page 21        SECTION 2
  1493.  
  1494.  
  1495.      prof 2          invalid; space is not allowed in a name
  1496.      2cost           invalid; the first character must not be 2
  1497.      profitcenter    invalid; more than 10 characters
  1498.  
  1499.           If the variable name is too long, only the first 10 characters
  1500.      are used (so PROFITCENTER1 and PROFITCENTER2 are the same for
  1501.      VP-Info Level 1, and will be stored as PROFITCENT).
  1502.  
  1503.           VP-Info Level 1 uses a number of words in its vocabulary, the so
  1504.      called VP-Info Level 1 keywords (see Appendix B).  It is suggested
  1505.      that keywords not be used as variable names.  In fact, the first four
  1506.      letters of a variable name should be different from the first four
  1507.      letters of a VP-Info Level 1 keyword, since VP-Info Level 1 identifies
  1508.      a keyword by its first four letters.  See, however, Section A.
  1509.  
  1510.           A variable has a type: character, numeric, or logical.
  1511.  
  1512.           A.   A variable of character type is also called a string
  1513.                variable.  A string variable contains a string (a text
  1514.                line); it has a width, the number of characters it contains.
  1515.  
  1516.           B.   A numeric variable contains a number; it has a width (the
  1517.                number of digits and, optionally, a decimal point), and the
  1518.                number of decimals.
  1519.  
  1520.           C.   A logical variable contains a logical value: T (true, also
  1521.                t, Y, y) or F (false, also f, N, n).
  1522.  
  1523.           For a field, the type and the width (and for numeric fields, the
  1524.      decimals) are fixed by the structure of the data file.  For a memory
  1525.      variable, all these may change any time a new value is stored to the
  1526.      variable.
  1527.  
  1528.           Fields are defined with the CREATE command, when the data file is
  1529.      set up, or with the MODIFY STRUCTURE command when the structure of the
  1530.      data file is modified.  The value of fields may be changed by a number
  1531.      of commands: REPLACE, EDIT, BROWSE, @ GET, and so on.
  1532.  
  1533.           Fields can also be referenced with the file name: MENU[2] is the
  1534.      second field of the data file MENU; TEST[210] is field 210 of the data
  1535.      file TEST.  Thus fields can be referenced as elements of a matrix.
  1536.  
  1537.           Memory variables are defined (and redefined) with the commands:
  1538.      =, STORE, ACCEPT, AVERAGE, COUNT, INPUT, READ(), SUM, WAIT.  WRAP()
  1539.      redefines the value of a memory variable.  @ GET redefines the value
  1540.      of a memory variable but does not change its characteristics.
  1541.  
  1542.           Matrix variables are handled somewhat differently; see
  1543.      Section 2.5.
  1544.  
  1545.           A memory variable can be declared GLOBAL.  This means that when a
  1546.      program is chained to another, GLOBAL variables are passed to the new
  1547.      program.  See the commands GLOBAL and CHAIN in Section 4.3.
  1548.  
  1549.  
  1550.  
  1551.      Variables                      VPI  VPIN                     Variables           VP-Info Level 1 Reference Manual         Page 22        SECTION 2
  1552.  
  1553.  
  1554.      MEMO FIELDS.  Memo fields are a special form that allows variable-length
  1555.      text of up to about 20,000 characters to be added to a record.  The memo
  1556.      is actually kept in a file associated with the data file, sharing the
  1557.      same name but with a DBT extension. See WRITE, EDIT and TEXT for details.
  1558.  
  1559.  
  1560.                           2.4. Variable Look-Up Rules
  1561.  
  1562.  
  1563.           When VP-Info Level 1 finds an expression in a command, it has to
  1564.      work out its value.  It follows a strict order as follows to determine
  1565.      what the item is:
  1566.  
  1567.                1.   Is it a function?
  1568.                2.   Is it a numeric constant?
  1569.                3.   Is it a string constant?
  1570.                4.   Is it a system variable?
  1571.                5.   Is it a matrix variable?
  1572.                6.   Is it a redirected field (e.g. name#3)?
  1573.                7.   Is it a field in the selected data file?
  1574.                8.   Is it a memory variable?
  1575.                9.   Is it a logical constant?
  1576.  
  1577.      If still not found, VP-Info Level 1 gives up and issues a Variable not
  1578.      found" error message.
  1579.  
  1580.           Note that a variable should not have the same name as a field,
  1581.      and neither variables nor fields should have the same name as one of
  1582.      the logical constants Y, N, T, or F.  The potential for puzzling
  1583.      behavior is obvious.
  1584.  
  1585.  
  1586.  
  1587.                              2.5. Matrix Variables
  1588.  
  1589.  
  1590.           A memory variable can be defined as a matrix with the DIM
  1591.      command.  A matrix variable is counted as only one memory variable
  1592.      within the 128 limit on the number of memory variables.
  1593.  
  1594.           Any one matrix variable can occupy up to 64K memory in high
  1595.      memory.  The available high memory is shown by the STATUS command.
  1596.      See the command DIM on how to compute the memory requirement, and
  1597.      Appendix 1 (Section A.1) on how VP-Info Level 1 uses memory.
  1598.  
  1599.           Here is an example on how to define a matrix:
  1600.  
  1601.      1>DIM NUM a[2,5]
  1602.      1>a[1,1]=34.78
  1603.      1>a[1,2]=45.7
  1604.      1>a[2,2]=1234.71
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.      Matrix Variables               VPI  VPIN              Matrix Variables           VP-Info Level 1 Reference Manual         Page 23        SECTION 2
  1611.  
  1612.  
  1613.      1>a[1,1]=34.78
  1614.      1>a[1,2]=45.7
  1615.      1>a[2,2]=1234.71
  1616.      1>a[2,4]=1000
  1617.      1>? a
  1618.          34.78     45.70      0.00      0.00      0.00
  1619.           0.00   1234.71      0.00   1000.00      0.00
  1620.  
  1621.           The SET WIDTH TO command can be used to influence how many items
  1622.      from the matrix are displayed in a line.
  1623.  
  1624.           Matrix variables can be assigned values only with the = and STORE
  1625.      commands.  Instead of
  1626.  
  1627.      ok=READ(a[5])
  1628.  
  1629.      write
  1630.  
  1631.      ok=READ(temp)
  1632.      a[5]=temp
  1633.  
  1634.           There is no limitation on the use of matrix variables in
  1635.      expressions.  A matrix variable may occur at any place where a
  1636.      function may occur.  You may think of a matrix variable as a special
  1637.      type of function that can store values.
  1638.  
  1639.           The REPEAT loop is convenient to manipulate matrix variables.
  1640.  
  1641.  
  1642.                              2.6. System Variables
  1643.  
  1644.  
  1645.           System variables carry information necessary for the running of
  1646.      VP-Info Level 1.  The command LIST SYSTEM lists the system variables
  1647.      (with the exception of :TERMINAL):
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.      System Variables               VPI  VPIN              System Variables           VP-Info Level 1 Reference Manual         Page 24        SECTION 2
  1670.  
  1671.  
  1672.  
  1673.      1>LIST SYSTEM
  1674.  
  1675.      Name          Type    Width    Contents
  1676.      :F1             C       5      HELP
  1677.      :F2             C      10      LIST STRU;
  1678.      :F3             C       6      WRITE
  1679.      :F4             C      10      LIST MEMO;
  1680.      :F5             C       7      BROWSE;
  1681.      :F6             C       5      STAT;
  1682.      :F7             C      12      ^wCONT;EDIT;
  1683.      :F8             C      11      LOCATE FOR
  1684.      :F9             C       5      FIND
  1685.      :F10            C       5      EDIT;
  1686.      :TIME           C       8      16:45:20
  1687.      :DATE           C      21      Monday, July 30, 1990
  1688.      :VERSION        C       4      510
  1689.      :SERIAL         C      10      2934906400
  1690.      :COMPANY        C      14      D&G Book Store
  1691.      :PICTURE        C      10      9999999.99
  1692.      :TITLE          C       1
  1693.      :UNDOC          C       1
  1694.      :KEY            N       8      13
  1695.      :AVAIL          N       8      0
  1696.      :FIELD          N       8      0
  1697.      :ERROR          N       8      0
  1698.      :MESSAGE        C       1
  1699.      :RETRY          N       8      25
  1700.      :USER           N       8      1
  1701.      :DIR            C       6      C:\TMP
  1702.      :NEAR           N       8      0
  1703.      :COLOR          N       8      48
  1704.      ** Total ** 28  variables... 216  bytes
  1705.  
  1706.  
  1707.           Function keys.  :F1 to :F10 are the system variables activated by
  1708.      pressing the keys <F1> to <F10>.  They can be assigned values with the
  1709.      commands =:
  1710.  
  1711.      :F1='street'
  1712.  
  1713.      or with the combination of Alt and function key.  For instance, Alt-
  1714.      F10 assigns the contents of the command line or editing field from the
  1715.      beginning to the cursor to <F10>.  See Section 1.2.
  1716.  
  1717.           :DATE and :TIME.  VP-Info Level 1 stores the date and time
  1718.      internally.  When VP-Info Level 1 is started, it reads the system date
  1719.      and time.  If you have a calendar card, the system date and time is
  1720.      the current date and time; otherwise, the date is 01/01/80 (or later)
  1721.      and the time is 00:00:00 at the time the computer was started.  (You
  1722.      can reset the system date and time with the operating system DATE and
  1723.      TIME commands.)
  1724.  
  1725.  
  1726.  
  1727.  
  1728.      System Variables               VPI  VPIN              System Variables           VP-Info Level 1 Reference Manual         Page 25        SECTION 2
  1729.  
  1730.  
  1731.  
  1732.           You can set VP-Info Level 1's date and time:
  1733.  
  1734.      1>:DATE='04/05/84'
  1735.      1>:TIME='08:12:56'
  1736.  
  1737.      (mm/dd/yy and hh:mm:ss format).
  1738.  
  1739.           The function TIME( returns the system time and sets :TIME to the
  1740.      system time.  The function DATE( with one parameter (the format)
  1741.      returns the date from :DATE in a specific format and rewrites :DATE to
  1742.      this format.  (See Section 3.4.)
  1743.  
  1744.           For instance,
  1745.  
  1746.      1>stamp=TIME()
  1747.  
  1748.      stores current system time to the memory variable STAMP, and resets
  1749.      :TIME.  The command
  1750.  
  1751.      1>REPLACE stamp WITH TIME()
  1752.  
  1753.      does the same for the field STAMP.
  1754.  
  1755.           :PICTURE. The :PICTURE system variable is a format for numbers
  1756.      (see Formatting numbers under the @ command).  This formats the
  1757.      display of all numeric memory variables and numeric expressions.  This
  1758.      format can be overridden by a format clause in TEXT or an @ command,
  1759.      or with the PIC( function.
  1760.  
  1761.           The system comes with :PICTURE as '999999.99'.  If you want
  1762.      higher precision, say three decimals:
  1763.  
  1764.      1>:PICTURE='999999.999'
  1765.  
  1766.           If you do not want fractions, but want millions:
  1767.  
  1768.      1>:PICTURE='9999999'
  1769.  
  1770.           The :PICTURE variable can contain format clauses with up to 12
  1771.      9s, with at many as 6 on the right side of the decimal point.
  1772.  
  1773.           It should be emphasized that the :PICTURE does not influence how
  1774.      VP-Info Level 1 stores or computes numbers; it only tells the language
  1775.      how to display them.
  1776.  
  1777.           Other system variables.  :VERSION contains the current version
  1778.      number of VP-Info Level 1.
  1779.  
  1780.           :SERIAL may contain the serial number.  Once VP-Info Level 1 is
  1781.      loaded, you may use this as a variable that survives a CLEAR command.
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.      System Variables               VPI  VPIN              System Variables           VP-Info Level 1 Reference Manual         Page 26        SECTION 2
  1788.  
  1789.  
  1790.  
  1791.           :COMPANY contains the company name.  This is used by the REPORT
  1792.      command.  (It can be changed to the name of the company you are
  1793.      reporting on.)
  1794.  
  1795.           :TITLE is the default title of a report.  See the REPORT command.
  1796.  
  1797.           :KEY is a numeric variable.  It contains the number generated by
  1798.      the last keystroke used to exit a process or execute a command.  See
  1799.      the function INKEY( for the definition of this number.  :KEY is used
  1800.      in VP-Info Level 1 programming to find out which key was pressed to
  1801.      abort or interrupt a procedure.
  1802.  
  1803.           :AVAIL contains the number of the next available volume in the
  1804.      current library file.  See SET LIBRARY command.
  1805.  
  1806.           :FIELD contains the number of the Get Table entry currently being
  1807.      processed. See ON FIELD command; VP-Info Professional only.
  1808.  
  1809.           :ERROR The current value of VP-Info Level 1's internal error
  1810.      variable.  Shows why execution of the last command failed.
  1811.  
  1812.           :MESSAGE The message from the MSG file associated with the error
  1813.      number contained in :ERROR
  1814.  
  1815.           :RETRY Controls what happens during network operations under VP-
  1816.      Info Professional Network Edition; has no meaning under other
  1817.      versions.
  1818.  
  1819.           :USER A number between 1 and 999 assigned to each user on a
  1820.      network under VP-Info Professional Network Edition.
  1821.  
  1822.           :DIR The user's current drive letter and directory.
  1823.  
  1824.           :NEAR The number of the record containing a key equal to or
  1825.      greater than the last FIND's FIND string.  See FIND command.
  1826.  
  1827.           :COLOR The current value of the color attribute written into the
  1828.      screen memory for every byte of screen display; set with SET COLOR TO
  1829.      or :COLOR= command.
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.      System Variables               VPI  VPIN              System Variables
  1847.      VP-Info Level 1 Reference Manual           Page 27           SECTION 3
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.               SECTION 3. VP-Info Level 1 FUNCTIONS AND EXPRESSIONS
  1854.  
  1855.  
  1856.           In VP-Info Level 1, expressions are formed from variables and
  1857.      constants using operations, relations, and functions.  Section 2.3
  1858.      introduced variables.  In this section, you will find the other
  1859.      ingredients of expressions: constants, operations, relations, and
  1860.      functions.  Finally, the expressions themselves are discussed.
  1861.  
  1862.  
  1863.  
  1864.                                  3.1. Constants
  1865.  
  1866.  
  1867.           There are three types of constants: numeric, logical, and string.
  1868.  
  1869.           A numeric constant is a number (the minus sign is a part of it):
  1870.  
  1871.      12.78
  1872.      0.00064
  1873.      -3.14
  1874.  
  1875.           There are only two logical constants:  T (true, also written as
  1876.      t, Y, and y) and F (false, also written as f, N, and n).
  1877.  
  1878.           A string constant is a string in quotation marks:
  1879.  
  1880.      "This is a character constant."
  1881.      'This is another one, delimited with single quotation marks.'
  1882.      "Here's another one, enclosing a single quotation mark (apostrophe)
  1883.           within double quotes."
  1884.      "This is incorrect because the quotation marks do not match.'
  1885.  
  1886.  
  1887.  
  1888.                                 3.2. Operations
  1889.  
  1890.  
  1891.           There are three types of operations: numeric, logical, and
  1892.      string.   Each works with constants and variables of that type, and
  1893.      yields a value of that type.
  1894.  
  1895.           The numeric operations are
  1896.  
  1897.      +     addition
  1898.      -     subtraction
  1899.      *     multiplication
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.      Operations                                                  Operations
  1906.      VP-Info Level 1 Reference Manual           Page 28           SECTION 3
  1907.  
  1908.  
  1909.      /     division
  1910.  
  1911.      2+3.2          yields 5.2
  1912.      10/4           yields 2.5
  1913.  
  1914.           All numeric operations require two numbers to act on.  - is also
  1915.      used to indicate that a number is negative: -2, -3.14.  Instead of
  1916.       -QTY, write 0-QTY or -1*QTY.
  1917.  
  1918.           There are three logical operations:
  1919.  
  1920.      .AND.
  1921.      .OR.
  1922.      .NOT.
  1923.  
  1924.           .AND. and .OR. take two logical values and yield a logical value:
  1925.  
  1926.      T.AND.T        yields:  T
  1927.      T.AND.F        yields:  F
  1928.      F.AND.T        yields:  F
  1929.      F.AND.F        yields:  F
  1930.  
  1931.      T.OR.T         yields:  T
  1932.      T.OR.F         yields:  T
  1933.      F.OR.T         yields:  T
  1934.      F.OR.F         yields:  F
  1935.  
  1936.           .NOT. takes a logical value and yields a logical value (the
  1937.      opposite):
  1938.  
  1939.      .NOT.T         yields:  F
  1940.      .NOT.F         yields:  T
  1941.  
  1942.           There is only one string operation:
  1943.  
  1944.      +     concatenation (placing one string after another)
  1945.  
  1946.      'This is a'+' sentence.'
  1947.  
  1948.      yields the value:
  1949.  
  1950.      This is a sentence.
  1951.  
  1952.           Note that one cannot mix numbers and strings:
  1953.  
  1954.      2+'string'
  1955.  
  1956.      will give a syntax error message (Error 1, see Appendix C).
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.      Operations                                                  Operations
  1965.      VP-Info Level 1 Reference Manual           Page 29           SECTION 3
  1966.  
  1967.  
  1968.  
  1969.                                  3.3. Relations
  1970.  
  1971.  
  1972.           A relation takes two numbers or two strings (compares them), and
  1973.      yields a logical value (true or false).
  1974.  
  1975.           There are six relations that compare numbers or strings:
  1976.  
  1977.      =     equal
  1978.      <     less than
  1979.      <=    less than or equal to
  1980.      >     greater than
  1981.      >=    greater than or equal to
  1982.      <>    not equal
  1983.  
  1984.           For numbers, these have their usual meaning:
  1985.  
  1986.      1<2            is true
  1987.      2<1            is false
  1988.      1.2<>5         is true
  1989.      1.2>=1         is true
  1990.  
  1991.           You should be careful when using = for numbers.  Two numbers may
  1992.      be displayed as equal while, in fact, they differ in the third or
  1993.      fourth decimal place.  Instead of
  1994.  
  1995.      num1=num2
  1996.  
  1997.      in many instances you could use
  1998.  
  1999.      ABS(num1-num2) < 0.01
  2000.  
  2001.      or
  2002.  
  2003.      (PIC(num1-num2,'9999.99'))=0
  2004.  
  2005.           For strings, string1=string2 is true if string2 is of the same
  2006.      length as string1, and the characters of string1 equal the
  2007.      corresponding characters of string2; if string2 has more characters,
  2008.      string1=string2 is always false.
  2009.  
  2010.           However, the result of comparing strings of unequal length, in
  2011.      which all of string2 is exactly the same as the beginning of string1,
  2012.      is affected by the setting of the "exact switch."  If SET EXACT OFF,
  2013.      then such string1=string2 is true,; with SET EXACT ON, it is false.
  2014.  
  2015.      Examples:
  2016.  
  2017.                            SET EXACT OFF       SET EXACT ON
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.      Relations                                                    Relations
  2024.      VP-Info Level 1 Reference Manual           Page 30           SECTION 3
  2025.  
  2026.  
  2027.  
  2028.           'abc'='abc'         true                true
  2029.           'abc '='abc'        true                false
  2030.           'abc'='abc '        false               false
  2031.           'abc'='ab'          true                false
  2032.           'ab'='abc'          false               false
  2033.  
  2034.           To make sure that two strings are really equal, write
  2035.  
  2036.      (string1=string2) .AND. (string2=string1)
  2037.  
  2038.      or SET EXACT ON.
  2039.  
  2040.           One way of remembering the above rule, is that string1=string2 if
  2041.      FIND with string2 finds string1.
  2042.  
  2043.           Although this definition of string1=string2 may at first sight
  2044.      seem awkward, it may really be quite useful both in Conversational
  2045.      VP-Info Level 1 and in VP-Info Level 1 programs.  For instance, the
  2046.      condition to select all customers (field: CUST) whose name starts with
  2047.      P:
  2048.  
  2049.      LEFT(cust,1)='P'         (or less efficiently SUBSTR(cust,1,1)='P')
  2050.  
  2051.      or
  2052.  
  2053.      cust='P'
  2054.  
  2055.      if SET EXACT OFF.
  2056.  
  2057.           For strings, string1 < string2 means: in a dictionary, string1
  2058.      would come before string2.  Single characters are compared by their
  2059.      ASCII value, see the functions CHR( and RANK(.  string1 is compared to
  2060.      string2 by comparing their first characters; if the first character of
  2061.      string1 is less than the first character of string2, then string1 <
  2062.      string2;  if they are equal, then the second character of string1 is
  2063.      compared to the second character of string 2, and so on.  Examples:
  2064.  
  2065.      'I am smaller' < 'I am bigger'    is false
  2066.      'David' < 'david'                 is true
  2067.      '122' > '17'                      is false
  2068.      '122' > '017'                     is true
  2069.      'seven' > '7'                     is true
  2070.  
  2071.           Note that in the ASCII sequence, all digits, 0 to 9, come before
  2072.      all upper-case letters, A to Z, which, in turn, come before all lower-
  2073.      case letters, a to z.
  2074.  
  2075.           Note that strings and numbers cannot be mixed in these relations:
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.      Relations                                                    Relations
  2083.      VP-Info Level 1 Reference Manual           Page 31           SECTION 3
  2084.  
  2085.  
  2086.      2 < '123'
  2087.  
  2088.      gives a syntax error message (Error 1, see list of error messages in
  2089.      Appendix).
  2090.  
  2091.  
  2092.  
  2093.                                  3.4. Functions
  2094.  
  2095.  
  2096.           A function is just like an operation; the addition operation (+)
  2097.      requires two arguments (numbers) and returns their sum; a function
  2098.      requires some arguments (0 to 3) and returns some value.
  2099.  
  2100.           Every function has a type: numeric, string, or logical, depending
  2101.      on the values it returns.
  2102.  
  2103.           A function has arguments; the values put into the function
  2104.      between the parentheses, separated by commas.  VP-Info Level 1
  2105.      functions have at most three arguments; a few have none.  Some
  2106.      arguments may be optional.
  2107.  
  2108.           The arguments can be variables or expressions of type string:
  2109.      <str var> or <str exp>, or of type numeric: <num var> or <num exp>.
  2110.      (Expressions are discussed in Section 3.5.)
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.      Functions                                                    Functions
  2142.      VP-Info Level 1 Reference Manual           Page 32           SECTION 3
  2143.  
  2144.  
  2145.  
  2146.                                        !(
  2147.  
  2148.      Converts a string to upper case.
  2149.  
  2150.      ╔════════════════════════════════════════════════════════════════════╗
  2151.      ║ !(<str exp>)                                                       ║
  2152.      ║                                                                    ║
  2153.      ║ <str exp>    the text to be converted to upper case                ║
  2154.      ╟─────────────────┐                                                  ║
  2155.      ║ Type: character │                                                  ║
  2156.      ╚═════════════════╧══════════════════════════════════════════════════╝
  2157.  
  2158.           All lower-case letters in the <str exp> are converted into upper
  2159.      case by the !( function.  See also the LOWER( function.
  2160.  
  2161.           Examples:
  2162.  
  2163.      1>a='Aa12b'
  2164.      1>? !(a)
  2165.      AA12B
  2166.      1>? !('David!')
  2167.      DAVID!
  2168.  
  2169.           Note that only the lower-case letters are changed.
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.      !(                         VPI1  VPI  VPIN                          !(
  2199.      VP-Info Level 1 Reference Manual           Page 33           SECTION 3
  2200.  
  2201.  
  2202.  
  2203.                                        #
  2204.  
  2205.      Gets the current record number.
  2206.  
  2207.      ╔════════════════════════════════════════════════════════════════════╗
  2208.      ║ #                                                                  ║
  2209.      ╟───────────────┐                                                    ║
  2210.      ║ Type: numeric │                                                    ║
  2211.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2212.  
  2213.           This function returns the record number of the current record of
  2214.      the selected file.  Note that ? # displays the current record number
  2215.      in the form specified by the system variable :PICTURE (see Section
  2216.      2.7).  VP-Info Level 1 also has a more general form of this function,
  2217.      RECNO(, which allows the user to specify file other than the selected
  2218.      file.
  2219.  
  2220.           When used with the option RECNO(filenum), it gives the record
  2221.      number of the current record in file filenum.
  2222.  
  2223.           Examples:
  2224.  
  2225.      1>USE employee
  2226.      1>? #
  2227.           1.00
  2228.      1>GO BOTTOM
  2229.      1>? #
  2230.           6.00
  2231.      1>GO TOP
  2232.      1>? #
  2233.           1.00
  2234.      1>SKIP 2
  2235.      1>? #
  2236.           3.00
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.                                 VPI1  VPI  VPIN                           #
  2256.      VP-Info Level 1 Reference Manual           Page 34           SECTION 3
  2257.  
  2258.  
  2259.  
  2260.                                        $(
  2261.  
  2262.      Gets a substring of a string.
  2263.  
  2264.      ╔════════════════════════════════════════════════════════════════════╗
  2265.      ║ $(<str exp>, <start num exp>, <width num exp>)                     ║
  2266.      ║                                                                    ║
  2267.      ║ <str exp>         the string from which the new string is formed   ║
  2268.      ║ <start num exp>   the position from which the new string is        ║
  2269.      ║                     taken                                          ║
  2270.      ║ <width num exp>   the number of characters to place in the         ║
  2271.      ║                     new string                                     ║
  2272.      ╟─────────────────┐                                                  ║
  2273.      ║ Type: character │                                                  ║
  2274.      ╚═════════════════╧══════════════════════════════════════════════════╝
  2275.  
  2276.           This function takes the string in <str exp> from position <start
  2277.      num exp> (fractions are thrown away); the number of characters taken
  2278.      is <width num exp>.  (In both numeric expressions, the fractions are
  2279.      disregarded).
  2280.  
  2281.           Examples:
  2282.  
  2283.      1>name='David Barberr'
  2284.      1>? $(name, 7,3)
  2285.      Bar
  2286.      1>? $(name, 7,12)
  2287.      Barberr
  2288.      1>? LEN($(name,7,12))
  2289.            7.00
  2290.  
  2291.           Note that $(name,7,12) is of width 7, not 12; there are only 7
  2292.      letters left in name from position 7.
  2293.  
  2294.      1>s=3
  2295.      1>t=1
  2296.      1>? $(name+name, (s+t)/2, 1.9)
  2297.      a
  2298.  
  2299.           Note that 1.9 was taken as 1.
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.      $(                         VPI1  VPI  VPIN                          $(
  2313.      VP-Info Level 1 Reference Manual           Page 35           SECTION 3
  2314.  
  2315.  
  2316.  
  2317.                                        *
  2318.  
  2319.      Determines whether a record is deleted.
  2320.  
  2321.      ╔════════════════════════════════════════════════════════════════════╗
  2322.      ║ *                                                                  ║
  2323.      ╟───────────────┐                                                    ║
  2324.      ║ Type: logical │                                                    ║
  2325.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2326.  
  2327.           In the selected file, the current record pointer points at a
  2328.      record.  If this record has been marked for deletion (in BROWSE or
  2329.      EDIT, or with the DELETE command), then * gives the value T;
  2330.      otherwise, it is false.
  2331.  
  2332.           Example:
  2333.  
  2334.  
  2335.      1>USE employee
  2336.      1>DELETE RECORD 2
  2337.            1 DELETE(S)
  2338.      1>GO 2
  2339.      1>? *
  2340.      T
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.      *                          VPI1  VPI  VPIN                           *
  2370.      VP-Info Level 1 Reference Manual           Page 36           SECTION 3
  2371.  
  2372.  
  2373.  
  2374.                                        @(
  2375.  
  2376.      Gets the location of a substring.
  2377.      
  2378.      ╔════════════════════════════════════════════════════════════════════╗
  2379.      ║ @(<find str exp>, <str exp>)                                       ║
  2380.      ║                                                                    ║
  2381.      ║ <find str exp>    the string searched for                          ║
  2382.      ║ <str exp>         the text to be searched                          ║
  2383.      ╟───────────────┐                                                    ║
  2384.      ║ Type: numeric │                                                    ║
  2385.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2386.  
  2387.           This function finds out whether a string: <find str exp> occurs
  2388.      in the string: <str exp>.  If it occurs, the function returns the
  2389.      character position of the first (left-most) substring of <str exp>
  2390.      which is the same as <find str exp>; if it does not occur, the
  2391.      function returns a 0.
  2392.  
  2393.           Examples:
  2394.  
  2395.      1>greeting='Good morning'
  2396.      1>? @('oo', greeting)
  2397.            2.00
  2398.      1>? @('good',greeting)
  2399.            0.00
  2400.  
  2401.      In a program:
  2402.  
  2403.      IF @(answer,'YNQynq')=0
  2404.  
  2405.      checks whether the user response is correct.
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.      @(                         VPI1  VPI  VPIN                          @(
  2427.      VP-Info Level 1 Reference Manual           Page 37           SECTION 3
  2428.  
  2429.  
  2430.  
  2431.                                       ASC(
  2432.  
  2433.      Converts a character to its ASCII number.
  2434.  
  2435.      ╔════════════════════════════════════════════════════════════════════╗
  2436.      ║ ASC(<str exp>)                                                     ║
  2437.      ║                                                                    ║
  2438.      ║ <str exp>         the first character of this string is converted  ║
  2439.      ╟───────────────┐                                                    ║
  2440.      ║ Type: numeric │                                                    ║
  2441.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2442.  
  2443.           The characters in the character set used by the computer are
  2444.      numbered from 0 to 255.  For the first character of the string
  2445.      <str exp>, ASC( returns the corresponding number.  RANK( is a synonym
  2446.      for ASC(.  See also the functions CHR(, CTONUM(, and NUMTOC(.
  2447.  
  2448.           Examples:
  2449.  
  2450.      1>? ASC('x')
  2451.         120.00
  2452.      1>? ASC('xyz')
  2453.         120.00
  2454.  
  2455.           Note that only the first character of the string matters.
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.      ASC(                       VPI1  VPI  VPIN                        ASC(
  2484.      VP-Info Level 1 Reference Manual           Page 38           SECTION 3
  2485.  
  2486.  
  2487.  
  2488.                                       AT(
  2489.  
  2490.      Gets the location of a substring . . . a synonym for @(
  2491.  
  2492.      ╔════════════════════════════════════════════════════════════════════╗
  2493.      ║ AT(<find str exp>, <str exp>)                                      ║
  2494.      ║                                                                    ║
  2495.      ║ <str exp>         the text to be searched                          ║
  2496.      ║ <find str exp>    the string searched for                          ║
  2497.      ╟───────────────┐                                                    ║
  2498.      ║ Type: numeric │                                                    ║
  2499.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2500.  
  2501.           This function is merely a synonym for @(. See @(.
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.      AT(                        VPI1  VPI  VPIN                         AT(
  2541.      VP-Info Level 1 Reference Manual           Page 39           SECTION 3
  2542.  
  2543.  
  2544.  
  2545.                                       BIT(
  2546.  
  2547.      Bit-set function determines if a given bit is 0 or 1
  2548.  
  2549.      ╔════════════════════════════════════════════════════════════════════╗
  2550.      ║ BIT(<string>,<bit position>)                                       ║
  2551.      ║                                                                    ║
  2552.      ║ <string>          a string or string variable to test              ║
  2553.      ║ <bit position>    a numeric expression; position of a given bit    ║
  2554.      ║                      within <string>                               ║
  2555.      ╟─────────────────┐                                                  ║
  2556.      ║ Type: logical   │                                                  ║
  2557.      ╚═════════════════╧══════════════════════════════════════════════════╝
  2558.  
  2559.           Each character in the ASCII character set is identified by an
  2560.      eight-bit binary number from 0 to 255 inclusive.  Each bit may be
  2561.      either 0 or 1; for example, the letter A has a decimal value of 65 and
  2562.      a binary value of 01000001.
  2563.  
  2564.           When used with the SET( and RESET( functions, which turn specific
  2565.      bits to 1 or 0 respectively, the BIT( function can be used to access
  2566.      large amounts of logical data much more compactly than in a set of
  2567.      logical variables.  BIT( returns T (true) if the specified bit is set
  2568.      (0), F (false) if not set (0).
  2569.  
  2570.           Note: Bit positions are counted differently than in some other
  2571.      schemes. In these functions, all bits are counted from the left of the
  2572.      string starting at 1, so that each character contains bits numbered as
  2573.      follows:
  2574.  
  2575.           1.   Bits 1 to 8.
  2576.           2.   Bits 9 to 16.
  2577.           3.   Bits 17 to 24.
  2578.           . . . and so on
  2579.  
  2580.           Example in a program:
  2581.  
  2582.           To print the binary value of each character in an input string:
  2583.  
  2584.      SET RAW ON         ;eliminates spaces between listed output
  2585.      DO WHILE t
  2586.         ACCEPT 'Enter a short string for binary representation: ' TO string
  2587.         IF string=' '
  2588.            BREAK
  2589.         ENDIF
  2590.         ?
  2591.         REPEAT LEN(string)*8 TIMES VARYING position
  2592.            ?? IFF(BIT(string,position),'1','0')
  2593.            IF MOD(position,8)=0
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.      BIT(                       VPI1  VPI  VPIN                        BIT(
  2600.      VP-Info Level 1 Reference Manual           Page 40           SECTION 3
  2601.  
  2602.  
  2603.               ?? ' '
  2604.            ENDIF
  2605.         ENDREPEAT
  2606.      ENDDO
  2607.  
  2608.           Now run the program:
  2609.  
  2610.      Enter a short string for binary representation: Bit
  2611.      01000010 01101001 01110100
  2612.      Enter a short string for binary representation:
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.      BIT(                       VPI1  VPI  VPIN                        BIT(
  2657.      VP-Info Level 1 Reference Manual           Page 41           SECTION 3
  2658.  
  2659.  
  2660.  
  2661.                                      BLANK(
  2662.  
  2663.      Creates a string of blanks or other specified characters.
  2664.  
  2665.      ╔════════════════════════════════════════════════════════════════════╗
  2666.      ║ BLANK(<num exp>[,<charnum>])                                       ║
  2667.      ║                                                                    ║
  2668.      ║ <num exp>    a number from 0 to 255                                ║
  2669.      ╟────────────────────────────────────────────────────────────────────╢
  2670.      ║ Option:                                                            ║
  2671.      ║ <charnum>    the ASCII number of the character used to fill the    ║
  2672.      ║                blank string; default is 32, the blank character    ║
  2673.      ╟─────────────────┐                                                  ║
  2674.      ║ Type: character │                                                  ║
  2675.      ╚═════════════════╧══════════════════════════════════════════════════╝
  2676.  
  2677.           This function creates a string of <num exp> blanks or other
  2678.      specified characters.
  2679.  
  2680.           When charnum is specified, many interesting effects can be
  2681.      created, particularly by using the special pattern characters in the
  2682.      IBM screen character set, 176-178, and the solid block character, 219.
  2683.  
  2684.           Examples:
  2685.  
  2686.      1>name='DAVID'
  2687.      1>? name+BLANK(15)+name
  2688.      DAVID               DAVID
  2689.      1>num=23
  2690.      1>? name+BLANK(num+5)+name
  2691.      DAVID                            DAVID
  2692.      1>? BLANK(20,65)
  2693.      AAAAAAAAAAAAAAAAAAAA
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.      BLANK(                     VPI1  VPI  VPIN                      BLANK(
  2714.      VP-Info Level 1 Reference Manual           Page 42           SECTION 3
  2715.  
  2716.  
  2717.  
  2718.                                       CEN(
  2719.  
  2720.      Centers a line of text.
  2721.  
  2722.      ╔════════════════════════════════════════════════════════════════════╗
  2723.      ║ CEN(<str exp>,<num exp>)                                           ║
  2724.      ║                                                                    ║
  2725.      ║ <str exp>    the text to be centered                               ║
  2726.      ║ <num exp>    the line width                                        ║
  2727.      ╟─────────────────┐                                                  ║
  2728.      ║ Type: character │                                                  ║
  2729.      ╚═════════════════╧══════════════════════════════════════════════════╝
  2730.  
  2731.           This function centers (from the present position) the text
  2732.      <str exp> in a line (column) with <num exp> characters.
  2733.  
  2734.           Examples:
  2735.  
  2736.      1>compiler='VP-Info Level 1'
  2737.      1>? CEN(compiler,40)
  2738.                VP-Info Level 1
  2739.      1>@ 10,20 SAY CEN('Center this',40)
  2740.  
  2741.           Note: the last command centers the text between columns 20 and
  2742.      60.
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.      CEN(                       VPI1  VPI  VPIN                        CEN(
  2771.      VP-Info Level 1 Reference Manual           Page 43           SECTION 3
  2772.  
  2773.  
  2774.  
  2775.                                       CHR(
  2776.  
  2777.      Converts an ASCII number to character.
  2778.  
  2779.      ╔════════════════════════════════════════════════════════════════════╗
  2780.      ║ CHR(<num exp>)                                                     ║
  2781.      ║                                                                    ║
  2782.      ║ <num exp>    a number from 0 to 255                                ║
  2783.      ╟─────────────────┐                                                  ║
  2784.      ║ Type: character │                                                  ║
  2785.      ╚═════════════════╧══════════════════════════════════════════════════╝
  2786.  
  2787.           The characters in the character set used by the computer are
  2788.      numbered from 0 to 255; this number for a character is called the
  2789.      ASCII number.  For a given <num exp> in this range, CHR(<num exp>) is
  2790.      the corresponding character.
  2791.  
  2792.           This function is useful to send control codes to the printer.
  2793.      For instance,
  2794.  
  2795.      1>? CHR(27)+CHR(120)+CHR(1)
  2796.  
  2797.      puts the Epson LQ-1500 printer into letter quality mode.
  2798.  
  2799.           The functions ASC( and RANK( do the reverse.  These functions
  2800.      combine nicely.  If the memory variable LETTER contains a letter of
  2801.      the alphabet (other than z or Z), then
  2802.  
  2803.      LETTER=CHR(ASC(LETTER)+1)
  2804.  
  2805.      places in LETTER the next letter of the alphabet.
  2806.  
  2807.           Examples:
  2808.  
  2809.           1.
  2810.  
  2811.      1>? CHR(120)
  2812.      x
  2813.      1>letter='C'
  2814.      1>? CHR(RANK(letter)+1)
  2815.      D
  2816.  
  2817.           2. To set a standard IBM or Epson printer into double-wide mode:
  2818.  
  2819.      1>SET PRINT ON
  2820.      1>? CHR(14)+'First line.'
  2821.  
  2822.      prints:
  2823.  
  2824.  
  2825.  
  2826.  
  2827.      CHR(                       VPI1  VPI  VPIN                        CHR(
  2828.      VP-Info Level 1 Reference Manual           Page 44           SECTION 3
  2829.  
  2830.  
  2831.      First line.                    in double-wide characters
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.      CHR(                       VPI1  VPI  VPIN                        CHR(
  2885.      VP-Info Level 1 Reference Manual           Page 45           SECTION 3
  2886.  
  2887.  
  2888.  
  2889.                                      CLOSE(
  2890.  
  2891.      Closes a DOS file.
  2892.  
  2893.      ╔════════════════════════════════════════════════════════════════════╗
  2894.      ║ CLOSE([filenum])                                                   ║
  2895.      ╟────────────────────────────────────────────────────────────────────╢
  2896.      ║ Option:                                                            ║
  2897.      ║                                                                    ║
  2898.      ║ <filenum>      the DOS file number (between 1 and 4)               ║
  2899.      ╟───────────────┐                                                    ║
  2900.      ║ Type: logical │                                                    ║
  2901.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2902.  
  2903.           This function closes the DOS file (in particular, the sequential
  2904.      file) opened with the ROPEN( or WOPEN( function.  It returns T if
  2905.      successful, F otherwise.  See the functions ROPEN(, WOPEN(, SEEK(,
  2906.      SSEEK(, READ(, WRITE(, GET(, PUT(, IN(, OUT(, and CLOSE).
  2907.  
  2908.           If filenum is not specified, filenum=1 is the default.
  2909.  
  2910.           Example:
  2911.  
  2912.      1>ok=ROPEN('a:label.prg',3)
  2913.      1>? ok
  2914.      T
  2915.      1>ok=CLOSE(3)
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.      CLOSE(                     VPI1  VPI  VPIN                      CLOSE(
  2942.      VP-Info Level 1 Reference Manual           Page 46           SECTION 3
  2943.  
  2944.  
  2945.  
  2946.                                       COL(
  2947.  
  2948.      Gets print column position.
  2949.  
  2950.      ╔════════════════════════════════════════════════════════════════════╗
  2951.      ║ COL()                                                              ║
  2952.      ╟───────────────┐                                                    ║
  2953.      ║ Type: numeric │                                                    ║
  2954.      ╚═══════════════╧════════════════════════════════════════════════════╝
  2955.  
  2956.           This function gives the current column position of the cursor; if
  2957.      the printer is on, it returns the column position of the printer head.
  2958.      See the commands SET PRINT ON and SET FORMAT TO PRINT, and the
  2959.      function ROW(.
  2960.  
  2961.           Example:
  2962.  
  2963.      @ ROW(),COL()+3 SAY 'Hello'
  2964.  
  2965.      prints 'Hello' starting three characters to the right of the end of
  2966.      the last printing.
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.      COL(                       VPI1  VPI  VPIN                        COL(
  2999.      VP-Info Level 1 Reference Manual           Page 47           SECTION 3
  3000.  
  3001.  
  3002.  
  3003.                                     CTONUM(
  3004.  
  3005.      Convert a hexadecimal string into a decimal number.
  3006.  
  3007.      ╔════════════════════════════════════════════════════════════════════╗
  3008.      ║ CTONUM(<type>,<string exp>)                                        ║
  3009.      ║                                  VP-Info Professional only         ║
  3010.      ║ <type>         the length of the numeric value to be returned      ║
  3011.      ║ <string exp>   the string to be evaluated as a hexadecimal value   ║
  3012.      ╟─────────────────┐                                                  ║
  3013.      ║ Type: numeric   │                                                  ║
  3014.      ╚═════════════════╧══════════════════════════════════════════════════╝
  3015.  
  3016.           A general conversion function for converting hexadecimal values
  3017.      into decimal numbers.  Input can be any length string or string
  3018.      variable up to eight characters as follows:
  3019.  
  3020.            Type     String Length  Returns
  3021.  
  3022.              1      1 byte         integer 0 to 255
  3023.              2      2 bytes        integer -32768 to 32767
  3024.              4      4 bytes        integer +/- 2 billion
  3025.              8      8 bytes        a floating point number
  3026.  
  3027.           If string is shorter, conversion still assumes the string is the
  3028.      format of the given width.  When <type> is 1, this function is
  3029.      equivalent to RANK( or ASC(.
  3030.  
  3031.           The NUMTOC( and CHR( functions convert numbers into strings.
  3032.  
  3033.           Do not confuse these function with STR( and VAL(, which convert
  3034.      decimal numbers into their string representations, and vice versa.
  3035.  
  3036.           Examples:
  3037.  
  3038.      1>? CTONUM(1,'a')
  3039.           97.00
  3040.      1>? CTONUM(2,'ab')
  3041.        25185.00
  3042.      1>? CTONUM(4,'abc')
  3043.      6513249.00
  3044.      1>? CTONUM(4,'abcd')        ;number too large for format in :PICTURE
  3045.      **********
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.      CTONUM(                        VPI  VPIN                       CTONUM(
  3056.      VP-Info Level 1 Reference Manual           Page 48           SECTION 3
  3057.  
  3058.  
  3059.           Note to users of VP-Info Version 1:
  3060.  
  3061.            Though not in the original Version 1 documentation, a function
  3062.      called CONVERT( was added and documented in a disk file supplied to
  3063.      later purchasers.  This function was broken into two separate
  3064.      functions, CTONUM( and NUMTOC(, in the current version.  Existing
  3065.      programs that use CONVERT( will have to be modified to work as
  3066.      expected under the current versions.
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.      CTONUM(                        VPI  VPIN                       CTONUM(
  3113.      VP-Info Level 1 Reference Manual           Page 49           SECTION 3
  3114.  
  3115.  
  3116.  
  3117.                                      DATE(
  3118.  
  3119.      Displays a date in a specific format.
  3120.  
  3121.      ╔════════════════════════════════════════════════════════════════════╗
  3122.      ║ DATE(<type>[,<str exp>])                                           ║
  3123.      ║                                                                    ║
  3124.      ║ <type>           one of 9 type basic date-output formats           ║
  3125.      ╟────────────────────────────────────────────────────────────────────╢
  3126.      ║ Option:                                                            ║
  3127.      ║                                                                    ║
  3128.      ║ <str exp>        the date to be converted                          ║
  3129.      ╟─────────────────┐                                                  ║
  3130.      ║ Type: character │                                                  ║
  3131.      ╚═════════════════╧══════════════════════════════════════════════════╝
  3132.  
  3133.           This function with only <type> specified rewrites the current
  3134.      system date in :DATE in the format specified by the <type>, and
  3135.      displays the result.
  3136.  
  3137.           This function with two parameters  (the format and the date)
  3138.      returns the given date in the specified format.  :DATE is not
  3139.      effected.
  3140.  
  3141.           The <type> can be given in either of two forms, a name or number
  3142.      (numeric expression) as follows:
  3143.  
  3144.           Type           Date-output format
  3145.  
  3146.           1 or YMD       6-character format without slashes: yymmdd
  3147.           2 or MDY       8-character format with slashes: mm/dd/yy
  3148.           3 or Char      Spelled out: Month dd, yyyy
  3149.           4 or Full      Spelled out: Weekday, Month dd, yyyy; valid only
  3150.                             for years 1980-2079
  3151.           5 or Lchar     Last day of month spelled out in format 3 (Char)
  3152.           6 or DMY       11-byte string in format dd-MMM-yyyy (example
  3153.                             03-NOV-1990)
  3154.           7 or Variable  formatted without slashes according to SET DATE TO
  3155.                             command (See SET DATE TO)
  3156.           8 or Long      8-character format without slashes: yyyymmdd
  3157.           9 or Last      Last day of month in format 1 (YMD) or 8 (Long),
  3158.                             depending on whether SET DATE TO command set
  3159.                             year to YY or YYYY
  3160.  
  3161.           Shortcut: When specifying type by name, only the first character
  3162.           is usually required. The exception is for Lchar, Long and Last,
  3163.           which require two characters to resolve ambiguity. If only one is
  3164.           given, Lchar is assumed.
  3165.  
  3166.  
  3167.  
  3168.  
  3169.      DATE(                      VPI1  VPI  VPIN                       DATE(
  3170.      VP-Info Level 1 Reference Manual           Page 50           SECTION 3
  3171.  
  3172.  
  3173.           <str exp> must contain the date in one of the following formats:
  3174.                mmddyy     ddmmyy     yymmdd
  3175.                mmddyyyy   ddmmyyyy   yyyymmdd
  3176.  
  3177.           Optionally, a slash, a hyphen, or a space may be used to separate
  3178.      the elements of these formats.  For example, YY/MM/DD, YY-MM-DD,
  3179.      DD MM YYYY are all equally valid.
  3180.  
  3181.           There should be two digits each for month and the day, and two or
  3182.      four digits for the year.  01 3 92 is not acceptable.  If <str exp> is
  3183.      not acceptable, then DATE( returns a string of blanks.
  3184.  
  3185.           In the event of ambiguity, dates will be decoded in accordance
  3186.      with the format set in the SET DATE TO command.  For example:
  3187.  
  3188.           SET DATE TO      date          is interpreted as  Comment
  3189.  
  3190.           'ddmmyy'         11/03/90      March 11, 1990
  3191.           'mmddyy'         11/03/90      November 3, 1990
  3192.           'mmddyy'         11/03/60      November 3, 2060   all dates
  3193.                                                             converted to
  3194.                                                             range 1980-2079
  3195.  
  3196.           See also the system variable :DATE in Section 2 and the command
  3197.      SET DATE TO.
  3198.  
  3199.           Examples:
  3200.  
  3201.      1>:DATE= '10/05/90'
  3202.      1>? :DATE
  3203.      10/05/90
  3204.      1>? DATE()
  3205.      19901005
  3206.      1>? :DATE
  3207.      19901005
  3208.      1>? DATE(1)
  3209.      901005
  3210.      1>? :DATE
  3211.      901005
  3212.      1>? DATE(2)
  3213.      10/05/90
  3214.      1>? :DATE
  3215.      10/05/90
  3216.      1>? DATE(3)
  3217.      October 5, 1990
  3218.      1>? :DATE
  3219.      October 5, 1990
  3220.      1>? DATE(4)
  3221.      Saturday, October 5, 1990
  3222.      1>? :DATE
  3223.  
  3224.  
  3225.  
  3226.      DATE(                      VPI1  VPI  VPIN                       DATE(
  3227.      VP-Info Level 1 Reference Manual           Page 51           SECTION 3
  3228.  
  3229.  
  3230.      Saturday, October 5, 1990
  3231.      1>? DATE(4,'12/08/90')
  3232.      Sunday, December 8, 1990
  3233.      1>? :DATE
  3234.      Saturday, October 5, 1990
  3235.      1>? DATE(5,'90-30-27')
  3236.      March 31, 1990
  3237.      1>? DATE(6,'03  27 90')
  3238.      27-Mar-1990
  3239.      1>? :DATE
  3240.      Saturday, October 5, 1990
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.      DATE(                      VPI1  VPI  VPIN                       DATE(
  3284.      VP-Info Level 1 Reference Manual           Page 52           SECTION 3
  3285.  
  3286.  
  3287.  
  3288.                                      DAYS(
  3289.  
  3290.      Computes dates and date differences in days.
  3291.  
  3292.      ╔════════════════════════════════════════════════════════════════════╗
  3293.      ║ DAYS(<str exp1>,<str exp2>)                                        ║
  3294.      ║ DAYS(<str exp>,<num exp>)                                          ║
  3295.      ║                                                                    ║
  3296.      ║ In the first form:                                                 ║
  3297.      ║      <str exp1> and <str exp2> are dates                           ║
  3298.      ║ In the second form:                                                ║
  3299.      ║      <str exp> is a date and <num exp> is a number                 ║
  3300.      ║─────────────────────────┐                                          ║
  3301.      ║ Type: numeric/character │                                          ║
  3302.      ╚═════════════════════════╧══════════════════════════════════════════╝
  3303.  
  3304.           In the first form, DAYS( returns the number of days between the
  3305.      two dates.  The result is an integer.
  3306.  
  3307.           In the second form, DAYS( returns the date (as a string) which is
  3308.      <num exp> days past or before the date <str exp>.
  3309.  
  3310.           The string expressions containing dates can be of many different
  3311.      formats (see the DATE( function for more examples):
  3312.  
  3313.                     yy/mm/dd    yy-mm-dd    yyyy mm dd
  3314.                     mm/dd/yy    mm-dd-yy    mm dd yy
  3315.  
  3316.           There should be two digits each for yy, mm, and dd, and four
  3317.      digits for yyyy.  01 3 90 is not acceptable.
  3318.  
  3319.           In the second form, the date is returned in the format set with
  3320.      the SET DATE TO command (default: mmddyyyy).  If you wish a different
  3321.      format, use the DATE( function.  See also MONTHS( and SET DATE TO.
  3322.  
  3323.           Examples:
  3324.  
  3325.      1>? DAYS('04 06 90','04 29 90')
  3326.           23.00
  3327.      1>? DAYS('01/01/88','01 23 90')
  3328.          753.00
  3329.      1>? DAYS('01/01/90','01 23 88')
  3330.         -708.00
  3331.      1>? DAYS('01/01/91','01 02 91')
  3332.            1.00
  3333.      1>? DAYS('01/02/91','01 01 91')
  3334.           -1.00
  3335.      1>? DAYS('02/28/88','03 01 88')    ;leap year
  3336.            2.00
  3337.  
  3338.  
  3339.  
  3340.      DAYS(                      VPI1  VPI  VPIN                       DAYS(
  3341.      VP-Info Level 1 Reference Manual           Page 53           SECTION 3
  3342.  
  3343.  
  3344.      1>? DAYS('02/28/90','03 01 90')    ;not a leap year
  3345.            1.00
  3346.      1>? DAYS('04 03 90',30)
  3347.      050290
  3348.      1>? DAYS('02 03 90',30)
  3349.      030590
  3350.      1>? DAYS('02 03 90',-3)
  3351.      010490
  3352.      1>? DAYS('020390',-30)
  3353.      010490
  3354.      1>monthday='0203'
  3355.      1>offset=30
  3356.      1>? DAYS(monthday+'90',offset+1)
  3357.      030690
  3358.  
  3359.           DAYS( and DATE( may be combined to form complex expressions.  For
  3360.      instance, the end of the month closest to today in the form set in the
  3361.      SET DATE TO command:
  3362.  
  3363.      DATE(7,DAYS(DATE(2),-15))
  3364.  
  3365.           See DATE( and MONTHS( functions, and SET DATE TO command.
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.      DAYS(                      VPI1  VPI  VPIN                       DAYS(
  3398.      VP-Info Level 1 Reference Manual           Page 54           SECTION 3
  3399.  
  3400.  
  3401.  
  3402.                                       DBF(
  3403.  
  3404.      Allows access to data-file attributes of a file in use.
  3405.  
  3406.      ╔════════════════════════════════════════════════════════════════════╗
  3407.      ║ DBF(<type>[,<filenum>])                                            ║
  3408.      ║                                                                    ║
  3409.      ║ <type>      the information required from the data file header     ║
  3410.      ╟────────────────────────────────────────────────────────────────────╢
  3411.      ║ Option:                                                            ║
  3412.      ║                                                                    ║
  3413.      ║ <filenum>   the data file number; default is the currently         ║
  3414.      ║               selected data file                                   ║
  3415.      ╟─────────────────────────┐                                          ║
  3416.      ║ Type: character/numeric │                                          ║
  3417.      ╚═════════════════════════╧══════════════════════════════════════════╝
  3418.  
  3419.           Each data file has a file head which contains information about
  3420.      its structure, most of which is displayed with the LIST STRUCTURE
  3421.      command.
  3422.  
  3423.           Using the DBF(, DBFX( and FLD( functions provides users access to
  3424.      this information in a programmable form suitable for display and use
  3425.      in expressions.
  3426.  
  3427.           The <type> can be given in either of two forms, a name or number
  3428.      (numeric expression) as follows:
  3429.  
  3430.           Type           Explanation                        Result
  3431.  
  3432.           1 or Type      file type ("1", "2" or "3")        string
  3433.           2 or Name      data file name                     string
  3434.           3 or Fields    number of fields in structure      integer
  3435.           4 or Records   number of records in file          integer
  3436.           5 or Indexes   number of indexes currently open   integer
  3437.           6 or Master    index number of master index       integer
  3438.  
  3439.           Shortcut: When specifying type by name, only the first character
  3440.           is required.
  3441.  
  3442.           Example:
  3443.  
  3444.      1>? DBF(type),DBF(n),DBF(fields),DBF(recs),DBF(indexes),DBF(master)
  3445.      1 CUSTOMER.DBF       9.00       4.00       2.00       1.00
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.      DBF(                       VPI1  VPI  VPIN                        DBF(
  3455.      VP-Info Level 1 Reference Manual           Page 55           SECTION 3
  3456.  
  3457.  
  3458.           Note to users of VP-Info Version 1:
  3459.  
  3460.           The DBF( function, though not in the original Version 1
  3461.      documentation, was added and documented in a disk file supplied to
  3462.      later purchasers.  Types 1 to 3 remain unchanged, but types 4 to 7 in
  3463.      the original DBF( function are now types 1 to 4 of the FLD( function.
  3464.      Existing programs that use DBF( may have to be modified to work as
  3465.      expected under the current versions.
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.      DBF(                       VPI1  VPI  VPIN                        DBF(
  3512.      VP-Info Level 1 Reference Manual           Page 56           SECTION 3
  3513.  
  3514.  
  3515.  
  3516.                                      DBFX(
  3517.  
  3518.      Gives additional information about an open data file; an extension to
  3519.      the DBF( function.
  3520.  
  3521.      ╔════════════════════════════════════════════════════════════════════╗
  3522.      ║ DBFX(<type> [,<filenum>])                                          ║
  3523.      ║                                  VP-Info Professional only         ║
  3524.      ║ <type>      one of three types of information as listed below      ║
  3525.      ╟────────────────────────────────────────────────────────────────────╢
  3526.      ║ Option:                                                            ║
  3527.      ║                                                                    ║
  3528.      ║ <filenum>   the data file number; default is the currently         ║
  3529.      ║               selected data file                                   ║
  3530.      ╟─────────────────┐                                                  ║
  3531.      ║ Type: logical   │                                                  ║
  3532.      ╚═════════════════╧══════════════════════════════════════════════════╝
  3533.  
  3534.           The DBF( and FLD( functions, available in both Level 1 and VP-Info
  3535.      Professional, provide information contained in the data file headers.
  3536.  
  3537.           VP-Info Professional provides this extended function to give
  3538.      three additional types of information in a programmable form suitable
  3539.      for display and use in expressions.
  3540.  
  3541.           The <type> can be given in either of two forms, a name or number
  3542.      (numeric expression) as follows:
  3543.  
  3544.           Type           Explanation                       
  3545.  
  3546.           1 or Filter    TRUE if a FILTER is in effect
  3547.           2 or Limit     TRUE if a LIMIT is in effect
  3548.           3 or Relation  TRUE if file is related to another
  3549.  
  3550.           Shortcut: When specifying type by name, only the first character
  3551.           is required.
  3552.  
  3553.  
  3554.           Examples:
  3555.  
  3556.      1>SET FILTER TO state='CA'
  3557.      1>? DBFX(filter)
  3558.      T
  3559.      1>? DBFX(r)
  3560.      F
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.      DBFX(                          VPI  VPIN                         DBFX(
  3569.      VP-Info Level 1 Reference Manual           Page 57           SECTION 3
  3570.  
  3571.  
  3572.  
  3573.                                     DELETED(
  3574.  
  3575.      Determines whether a record is deleted.
  3576.  
  3577.      ╔════════════════════════════════════════════════════════════════════╗
  3578.      ║ DELETED(<filenum>)                                                 ║
  3579.      ╟────────────────────────────────────────────────────────────────────╢
  3580.      ║ Option:                                                            ║
  3581.      ║                                                                    ║
  3582.      ║ <filenum>    the number of the data file to be checked             ║
  3583.      ╟───────────────┐                                                    ║
  3584.      ║ Type: logical │                                                    ║
  3585.      ╚═══════════════╧════════════════════════════════════════════════════╝
  3586.  
  3587.           In a specified data file, the current record pointer points at a
  3588.      record.  If this record has been marked for deletion (in BROWSE or
  3589.      EDIT, or with the DELETE command), then DELETED( gives the value T;
  3590.      otherwise, it is false.
  3591.  
  3592.           This is a more general firm of the * function, which operates the
  3593.      same way as DELETED( but, because it allows no parameter, works only
  3594.      with the currently selected data file.
  3595.  
  3596.           Examples:
  3597.  
  3598.      1>? DELETED(4)
  3599.      T
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.      DELETED(                   VPI1  VPI  VPIN                    DELETED(
  3626.      VP-Info Level 1 Reference Manual           Page 58           SECTION 3
  3627.  
  3628.  
  3629.  
  3630.                                       DIR(
  3631.  
  3632.      Get file information from disk directory.
  3633.  
  3634.      ╔════════════════════════════════════════════════════════════════════╗
  3635.      ║ DIR([<filespec>])                                                  ║
  3636.      ║                                                                    ║
  3637.      ║ Option:                                                            ║
  3638.      ║                                                                    ║
  3639.      ║ <filespec>    a string or string expression containing a file name ║
  3640.      ║                 (or skeleton using ? and/or * wildcards), with     ║
  3641.      ║                 optional drive and/or path specification           ║
  3642.      ╟─────────────────┐                                                  ║
  3643.      ║ Type: character │                                                  ║
  3644.      ╚═════════════════╧══════════════════════════════════════════════════╝
  3645.  
  3646.           Searches for specific files specified by the drive path,
  3647.      subdirectory and/or filename and provides specific information on
  3648.      files found.
  3649.  
  3650.           If an argument is given, it must be a string or string expression
  3651.      naming a file, with * and ? wildcards optional). Returns the first
  3652.      file name found matching <filespec>. If no match was found, blank is
  3653.      returned.
  3654.  
  3655.           If no argument is given, the previous <filespec> is used to find
  3656.      the next matching file. If no more matching file names are found,
  3657.      blank is returned.
  3658.  
  3659.           Examples:
  3660.  
  3661.      DIR('c:\path\*.bak')
  3662.  
  3663.      locates the first file with extension BAK in the subdirectory \PATH,
  3664.      while
  3665.  
  3666.      DIR('*.bak')
  3667.  
  3668.      locates the first file with extension BAK in the current directory.
  3669.  
  3670.           If a file is found with Form 1, entering DIR() with no parameters
  3671.      will locate the next file meeting the <filespec>.  This will continue
  3672.      until the response is a blank, indicating there are no more files
  3673.      meeting the <filespec>.
  3674.  
  3675.  
  3676.           Note to users of VP-Info Version 1:
  3677.  
  3678.           The DIR( function, though not in the original Version 1
  3679.      documentation, was added and documented in a disk file supplied to
  3680.  
  3681.  
  3682.      DIR(                       VPI1  VPI  VPIN                        DIR(
  3683.      VP-Info Level 1 Reference Manual           Page 59           SECTION 3
  3684.  
  3685.  
  3686.      later purchasers.  One of the forms of the original DIR( function has
  3687.      been made into a separate function, DIRX(.  Existing programs that use
  3688.      DBF( may have to be modified to work as expected under the current
  3689.      versions.
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.      DIR(                       VPI1  VPI  VPIN                        DIR(
  3740.      VP-Info Level 1 Reference Manual           Page 60           SECTION 3
  3741.  
  3742.  
  3743.  
  3744.                                      DIRX(
  3745.  
  3746.      Obtain additional information about file located with the DIR(
  3747.      function.
  3748.  
  3749.      ╔════════════════════════════════════════════════════════════════════╗
  3750.      ║ DIRX(<type>)                                                       ║
  3751.      ║                                  VP-Info Professional only         ║
  3752.      ║ <type>    the name or number of the information required about     ║
  3753.      ║             a file                                                 ║
  3754.      ╟─────────────────────────┐                                          ║
  3755.      ║ Type: character/numeric │                                          ║
  3756.      ╚═════════════════════════╧══════════════════════════════════════════╝
  3757.  
  3758.           Once a file is identified with DIR(, additional information can
  3759.      be obtained from the DOS directory in a form suitable for use in a
  3760.      program.
  3761.  
  3762.           The <type> can be given in either of two forms, a name or number
  3763.      (numeric expression) as follows:
  3764.  
  3765.           Type           Explanation                         Result
  3766.  
  3767.           1 or Name      last file name found with DIR(      string
  3768.           2 or Size      size in bytes of last name found
  3769.                               with DIR(                      integer
  3770.           3 or Attribute DOS file attribute as follows       integer
  3771.                               1 - directory
  3772.                               2 - system
  3773.                               3 - hidden
  3774.                               4 - read only
  3775.                               5 - normal
  3776.           4 or Time      time file created or last updated   string
  3777.           5 or Date      date file created or last updated   string
  3778.  
  3779.           Shortcut: When specifying type by name, only the first character
  3780.           is required.
  3781.  
  3782.           These functions have many uses. Use them to write a program that
  3783.      backs up recently modified files, a program that lists files so the
  3784.      user can pick one, etc.
  3785.  
  3786.           Examples:
  3787.  
  3788.      DIR(n) returns the filename
  3789.      DIR(a) returns 4 if the file is read only
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.      DIRX(                          VPI  VPIN                         DIRX(
  3797.      VP-Info Level 1 Reference Manual           Page 61           SECTION 3
  3798.  
  3799.  
  3800.  
  3801.                                       EOF
  3802.  
  3803.      Gives the end-of-file flag for the currently selected data file.
  3804.  
  3805.      ╔════════════════════════════════════════════════════════════════════╗
  3806.      ║ EOF                                                                ║
  3807.      ╟───────────────┐                                                    ║
  3808.      ║ Type: logical │                                                    ║
  3809.      ╚═══════════════╧════════════════════════════════════════════════════╝
  3810.  
  3811.           If the current record pointer is on the last record of the file
  3812.      in use and a SKIP is issued, EOF returns T (true); otherwise it is F
  3813.      (false).  Since SKIP n is treated as n SKIP commands, EOF returns true
  3814.      if SKIP n goes past the last record.  Also, if a LOCATE or CONTINUE
  3815.      command is unsuccessful, or if NEAREST does not find an index key
  3816.      equal to or greater than the FIND string, EOF returns T.
  3817.  
  3818.           Examples:
  3819.  
  3820.      1>USE employee
  3821.      1>GO 4
  3822.      1>SKIP 2
  3823.      1>? #
  3824.            6.00
  3825.      1>? EOF
  3826.      F
  3827.      1>SKIP
  3828.      1>? EOF
  3829.      T
  3830.      1>GO 4
  3831.      1>SKIP 3
  3832.      1>? #
  3833.            6.00
  3834.      1>? EOF
  3835.      T
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.      EOF                        VPI1  VPI  VPIN                         EOF
  3854.      VP-Info Level 1 Reference Manual           Page 62           SECTION 3
  3855.  
  3856.  
  3857.  
  3858.                                       EOF(
  3859.  
  3860.      Gives the end-of-file flag for a specified data file.
  3861.  
  3862.      ╔════════════════════════════════════════════════════════════════════╗
  3863.      ║ EOF([<filenum>])                                                   ║
  3864.      ║                                                                    ║
  3865.      ╟────────────────────────────────────────────────────────────────────╢
  3866.      ║ Option:                                                            ║
  3867.      ║                                                                    ║
  3868.      ║ <filenum>    the number of the data file to be checked             ║
  3869.      ╟─────────────────┐                                                  ║
  3870.      ║ Type: logical   │                                                  ║
  3871.      ╚═════════════════╧══════════════════════════════════════════════════╝
  3872.  
  3873.           For the data file number specified, if the current record pointer
  3874.      is on the last record and a SKIP is issued, EOF( returns T (true);
  3875.      otherwise it is F (false).  Since SKIP n is treated as n SKIP
  3876.      commands, EOF( returns true if SKIP n goes past the last record.
  3877.  
  3878.           Also, if a LOCATE or CONTINUE command is unsuccessful, or if
  3879.      NEAREST does not find an index key equal to or greater than the FIND
  3880.      string, EOF( returns T.
  3881.  
  3882.           An extended form of the EOF( function which, since it takes no
  3883.      parameter, works only on the currently selected data file.  If no
  3884.      <filenum> is specified, the current file is assumed.
  3885.  
  3886.           Examples:
  3887.  
  3888.      1>USE employee
  3889.      1>GO 4
  3890.      1>SKIP 2
  3891.      1>? #
  3892.            6.00
  3893.      1>? EOF()
  3894.      F
  3895.      1>SELECT 2
  3896.      2>SKIP
  3897.      2>? EOF()
  3898.      T
  3899.      2>GO BOTTOM
  3900.      2>SKIP
  3901.      2>? #
  3902.            6.00
  3903.      2>SELECT 1
  3904.      1>? EOF(2)
  3905.      T
  3906.  
  3907.  
  3908.  
  3909.  
  3910.      EOF(                       VPI1  VPI  VPIN                        EOF(
  3911.      VP-Info Level 1 Reference Manual           Page 63           SECTION 3
  3912.  
  3913.  
  3914.  
  3915.                                      FIELD(
  3916.  
  3917.      Get the number of the Get Table entry corresponding to a variable or
  3918.      field name.
  3919.  
  3920.      ╔════════════════════════════════════════════════════════════════════╗
  3921.      ║ FIELD(<name>)                                                      ║
  3922.      ║                                                                    ║
  3923.      ║ <name>    the name of field or variable in a Get Table             ║
  3924.      ╟─────────────────┐                                                  ║
  3925.      ║ Type: numeric   │                                                  ║
  3926.      ╚═════════════════╧══════════════════════════════════════════════════╝
  3927.  
  3928.           While in full-screen editing mode (with READ, BROWSE, EDIT,
  3929.      etc.), each input variable and field is put into a Get Table that can
  3930.      be controlled with an ON FIELD structure.
  3931.  
  3932.           FIELD( returns the number from 1 to 64 of any editing field on
  3933.      screens created with @ GET and TEXT macros.  This function is usually
  3934.      used on an ON FIELD structure to redirect the sequence of data entry.
  3935.  
  3936.           See READ and ON FIELD in the Command Reference section.
  3937.  
  3938.           Example in a program:
  3939.  
  3940.      ON FIELD
  3941.      FIELD qty
  3942.         IF qty<0
  3943.            @ 22,0 say CEN('Quantity cannot be negative. Press any key',80)
  3944.            cc=INKEY()
  3945.            ERASE 22,22
  3946.            :FIELD=FIELD(qty)
  3947.         ENDIF
  3948.      ENDON
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.      FIELD(                     VPI1  VPI  VPIN                      FIELD(
  3968.      VP-Info Level 1 Reference Manual           Page 64           SECTION 3
  3969.  
  3970.  
  3971.  
  3972.                                      FILE(
  3973.  
  3974.      Verifies whether a file exists.
  3975.  
  3976.      ╔════════════════════════════════════════════════════════════════════╗
  3977.      ║ FILE(<str exp>)                                                    ║
  3978.      ║                                                                    ║
  3979.      ║ <str exp>         file name                                        ║
  3980.      ╟───────────────┐                                                    ║
  3981.      ║ Type: logical │                                                    ║
  3982.      ╚═══════════════╧════════════════════════════════════════════════════╝
  3983.      
  3984.           This function looks up the file whose name is given by <str exp>;
  3985.      if the file is found, the function returns T, otherwise it returns F.
  3986.  
  3987.           If no extension is given in the file name, DBF is assumed (a data
  3988.      file is looked for).  See also SET DEFAULT TO for the default drive.
  3989.  
  3990.           Examples:
  3991.  
  3992.      1>? FILE('employee')
  3993.      T
  3994.      1>? FILE('a:read.me')
  3995.      T
  3996.      1>mfile='read.me'
  3997.      1>? FILE(mfile)
  3998.      F
  3999.      1>? FILE('a:'+mfile)
  4000.      T
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.      FILE(                      VPI1  VPI  VPIN                       FILE(
  4025.      VP-Info Level 1 Reference Manual           Page 65           SECTION 3
  4026.  
  4027.  
  4028.  
  4029.                                       FLD(
  4030.  
  4031.      Get information about a field in a data file.
  4032.  
  4033.      ╔════════════════════════════════════════════════════════════════════╗
  4034.      ║ FLD(<type>,<fieldnum> [,<filenum>])                                ║
  4035.      ║                                                                    ║
  4036.      ║ <type>       one of the four attributes of a field                 ║
  4037.      ║ <fieldnum>   the number of the field to be checked                 ║
  4038.      ╟────────────────────────────────────────────────────────────────────╢
  4039.      ║ Option:                                                            ║
  4040.      ║                                                                    ║
  4041.      ║ <filenum>    the number of the data file to be checked             ║
  4042.      ╟─────────────────────────┐                                          ║
  4043.      ║ Type: character/numeric │                                          ║
  4044.      ╚═════════════════════════╧══════════════════════════════════════════╝
  4045.  
  4046.           Each field in a data file has four attributes as shown with the
  4047.      LIST STRUCTURE command: name, type, width and (for numeric variables)
  4048.      number of decimal places.  The FLD( function is often used in
  4049.      conjunction with the DBF( function.
  4050.  
  4051.           These attributes can be retrieved in a form suitable for use in a
  4052.      program with the FLD( function.
  4053.  
  4054.           The <type> can be given in either of two forms, a name or number
  4055.      (numeric expression) as follows:
  4056.  
  4057.           Type           Explanation                              Result
  4058.  
  4059.  
  4060.           1 or Name      string containing field name             string
  4061.           2 or Type      string containing field type             string
  4062.           3 or Width     number containing width of field         integer
  4063.           4 or Decimals  number of decimal places in field        integer
  4064.  
  4065.           Shortcut: When specifying type by name, only the first character
  4066.           is required.
  4067.  
  4068.  
  4069.           Example in a program:
  4070.  
  4071.      REPEAT DBF(records) TIMES varying fldnum
  4072.         REPEAT 4 times VARYING type
  4073.            ?? FLD(type,fldnum)
  4074.         ENDREPEAT
  4075.         ?
  4076.      ENDREPEAT
  4077.  
  4078.  
  4079.  
  4080.  
  4081.      FLD(                       VPI1  VPI  VPIN                        FLD(
  4082.      VP-Info Level 1 Reference Manual           Page 66           SECTION 3
  4083.  
  4084.  
  4085.  
  4086.                                       GET(
  4087.  
  4088.      Gets a string from a DOS file.
  4089.  
  4090.      ╔════════════════════════════════════════════════════════════════════╗
  4091.      ║ GET(<str var>,<width num exp>[,filenum])                           ║
  4092.      ║                                                                    ║
  4093.      ║ <str var>          stores the string                               ║
  4094.      ║ <width num exp>    the width of the string requested;              ║
  4095.      ║                      must be in range 1 to 254                     ║
  4096.      ╟────────────────────────────────────────────────────────────────────╢
  4097.      ║ Option:                                                            ║
  4098.      ║                                                                    ║
  4099.      ║ filenum            the DOS file number (between 1 and 4)           ║
  4100.      ╟───────────────┐                                                    ║
  4101.      ║ Type: logical │                                                    ║
  4102.      ╚═══════════════╧════════════════════════════════════════════════════╝
  4103.  
  4104.           This function imports a string of <width num exp> characters from
  4105.      a DOS file opened with the ROPEN( function; the character number
  4106.      pointer is normally positioned with the SEEK( function.
  4107.  
  4108.           If successful in getting all the bytes requested, GET( returns T
  4109.      (true) and sets <str var> to the string imported from the file.  If
  4110.      <str var> does not exist, GET( will create it.
  4111.  
  4112.           If the function is unsuccessful, it returns F (false).  This will
  4113.      be the result if the GET( function tries to get data beyond the end of
  4114.      the file.  Note, however, that even if GET( returns F, one of more
  4115.      characters may still have been imported from the file; it is wise to
  4116.      check the value and width of <str var> to ensure part of a file is not
  4117.      lost.
  4118.  
  4119.           If filenum is not given, filenum=1 is assumed.
  4120.  
  4121.           GET( READ(, IN(, and WRAP( are the only functions that change the
  4122.      contents of the memory variable used as an argument.
  4123.  
  4124.           See also the functions ROPEN(, WOPEN(, CLOSE(, SEEK(, PUT(.
  4125.  
  4126.           Example in a program:
  4127.  
  4128.      IF ROPEN('test',3)
  4129.         DO WHILE GET(string,80,3)
  4130.            ? string
  4131.         ENDDO
  4132.      ENDIF
  4133.      ok=CLOSE(3)
  4134.  
  4135.  
  4136.  
  4137.  
  4138.      GET(                       VPI1  VPI  VPIN                        GET(
  4139.      VP-Info Level 1 Reference Manual           Page 67           SECTION 3
  4140.  
  4141.  
  4142.  
  4143.                                       IFF(
  4144.  
  4145.      Allows IF...THEN logic in expressions.
  4146.  
  4147.      ╔════════════════════════════════════════════════════════════════════╗
  4148.      ║ IFF(<cond>,<exptrue>,<expfalse>)                                   ║
  4149.      ║                                                                    ║
  4150.      ║ <cond>       a logical expression                                  ║
  4151.      ║ <exptrue>    the expression to be returned if <cond> is TRUE       ║
  4152.      ║ <expfalse>   the expression to be returned if <cond> is FALSE      ║
  4153.      ╟─────────────────────────────────┐                                  ║
  4154.      ║ Type: character/numeric/logical │                                  ║
  4155.      ╚═════════════════════════════════╧══════════════════════════════════╝
  4156.  
  4157.           This function returns <exptrue> if <cond> is true, <expfalse>
  4158.      otherwise. The type of the value returned is the same as the
  4159.      expression selected by the condition.
  4160.  
  4161.      IFF( is very useful in the FIELDS line of reports or in commands such
  4162.      as SUM, AVERAGE, REPLACE, or LIST.
  4163.  
  4164.           Examples:
  4165.  
  4166.      1>? IFF(married,'Married','Single ')
  4167.      1>SUM IFF(quant>500, quant*price, 0),IFF(state='NY',1,0)
  4168.  
  4169.           The first command prints "Married" or "Single" according to the
  4170.      value of a logical field named MARRIED. The second command will return
  4171.      the sum of all quantities for transactions where quantity is greater
  4172.      than 500, and a count of all records where STATE='NY', thus combining
  4173.      two separate commands (SUM FOR and COUNT FOR) into one.
  4174.  
  4175.                Caution: do not use expressions of different types or widths
  4176.           in reports, since this may cause the REPORT command to fail.
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.      IFF(                       VPI1  VPI  VPIN                        IFF(
  4196.      VP-Info Level 1 Reference Manual           Page 68           SECTION 3
  4197.  
  4198.  
  4199.  
  4200.                                       IN(
  4201.  
  4202.      Inputs a single character from a sequential file.
  4203.  
  4204.      ╔════════════════════════════════════════════════════════════════════╗
  4205.      ║ IN(<str var>[,<filenum>])                                          ║
  4206.      ║                                                                    ║
  4207.      ║ <str var>      stores the character                                ║
  4208.      ╟────────────────────────────────────────────────────────────────────╢
  4209.      ║ Option:                                                            ║
  4210.      ║                                                                    ║
  4211.      ║ <filenum>      the DOS file number (between 1 and 4)               ║
  4212.      ╟───────────────┐                                                    ║
  4213.      ║ Type: logical │                                                    ║
  4214.      ╚═══════════════╧════════════════════════════════════════════════════╝
  4215.  
  4216.           This function reads the next character of the DOS file (opened
  4217.      with the ROPEN( function) into the string variable <str var>; if
  4218.      <str var> does not exist, it will be created.  <str var> cannot be a
  4219.      matrix variable.
  4220.  
  4221.           If filenum is not given, filenum=1 is assumed.  IN( returns T if
  4222.      successful, F otherwise.
  4223.  
  4224.           This function is especially useful to communicate over the
  4225.      standard COM1, COM2 devices, for conversion of Word Star or other non-
  4226.      standard files to standard ASCII files, to encrypt/decrypt a file
  4227.      through a translation table.
  4228.  
  4229.           IN(, GET(, READ(, and WRAP( are the only functions that change
  4230.      the contents of the memory variable used as an argument.
  4231.  
  4232.           See the functions OUT(, ROPEN(, WOPEN(, SEEK(, SSEEK(, and
  4233.      CLOSE(.
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.      IN(                        VPI1  VPI  VPIN                         IN(
  4253.      VP-Info Level 1 Reference Manual           Page 69           SECTION 3
  4254.  
  4255.  
  4256.  
  4257.                                      IFKEY(
  4258.  
  4259.      Tests if a character is waiting in the keyboard buffer.
  4260.  
  4261.      ╔════════════════════════════════════════════════════════════════════╗
  4262.      ║ IFKEY()                                                            ║
  4263.      ║                                  VP-Info Professional only         ║
  4264.      ╟─────────────────┐                                                  ║
  4265.      ║ Type: logical   │                                                  ║
  4266.      ╚═════════════════╧══════════════════════════════════════════════════╝
  4267.  
  4268.           It is often useful to test whether a key has been pressed on the
  4269.      keyboard without waiting indefinitely if a key is not pressed.
  4270.  
  4271.           The IFKEY( function returns T (true) if a keystroke is waiting in
  4272.      the keyboard buffer, F (false) if not.  The keyboard buffer is not
  4273.      affected.
  4274.  
  4275.           Example in a program, to create a timing loop that ends as soon
  4276.      as any key is pressed:
  4277.  
  4278.      start=VAL(TIME(seconds))
  4279.      DO WHILE VAL(TIME(seconds))-start<3
  4280.         IF IFKEY()
  4281.            BREAK
  4282.         ENDIF
  4283.      ENDDO
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.      IFKEY(                         VPI  VPIN                        IFKEY(
  4310.      VP-Info Level 1 Reference Manual           Page 70           SECTION 3
  4311.  
  4312.  
  4313.  
  4314.                                      INKEY(
  4315.  
  4316.      Waits and gets numeric value of keyboard entry.
  4317.  
  4318.      ╔════════════════════════════════════════════════════════════════════╗
  4319.      ║ INKEY()                                                            ║
  4320.      ╟───────────────┐                                                    ║
  4321.      ║ Type: numeric │                                                    ║
  4322.      ╚═══════════════╧════════════════════════════════════════════════════╝
  4323.  
  4324.           This function suspends program execution until a key is pressed.
  4325.      It returns a number identifying the key.  Nothing is displayed on the
  4326.      screen.  Any key can be read (except Alt, Ctrl, and shift which merely
  4327.      affect the characters produced by other keys) including all function
  4328.      keys, editing keys, and alternate keys.  (Function keys F11 and F12
  4329.      are not recognized by many computers' BIOS programs, and are ignored
  4330.      by VP-Info Level 1.)
  4331.  
  4332.           Standard keys are identified with their ASCII number; see the
  4333.      functions CHR( and ASC(.  Other keys return values between 256 and
  4334.      511.
  4335.  
  4336.           Examples:
  4337.  
  4338.  
  4339.                     Key                     INKEY()
  4340.  
  4341.                     Ctrl-C                    3
  4342.                     A                        65
  4343.                     Alt-A                   285
  4344.                     <F1>                    315
  4345.                     Shift-<F1>              340
  4346.                     Ctrl-<F1>               350
  4347.                     Alt-<F1>                360
  4348.  
  4349.  
  4350.           To find out the number identifying a key, give the command:
  4351.  
  4352.      1>? INKEY()
  4353.  
  4354.      and press <ENTER>, then the key; the character's number will be
  4355.      displayed.
  4356.  
  4357.           Using INKEY() the user can program his own EDIT, set up cursor
  4358.      controlled menus, and so on.
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.      INKEY(                     VPI1  VPI  VPIN                      INKEY(
  4367.      VP-Info Level 1 Reference Manual           Page 71           SECTION 3
  4368.  
  4369.  
  4370.  
  4371.                                     INSERT(
  4372.  
  4373.      Overwrites a string at a given position with another string.
  4374.  
  4375.      ╔════════════════════════════════════════════════════════════════════╗
  4376.      ║ INSERT(<str expover>,<str exp>,<num exp>)                          ║
  4377.      ║                                                                    ║
  4378.      ║ <str expover>   the string expression to overwrite                 ║
  4379.      ║ <str exp>       the string expression to overwrite with            ║
  4380.      ║ <num exp>       the position                                       ║
  4381.      ╟─────────────────┐                                                  ║
  4382.      ║ Type: character │                                                  ║
  4383.      ╚═════════════════╧══════════════════════════════════════════════════╝
  4384.  
  4385.           This function takes the string in <str expover> and overwrites
  4386.      the string with <str exp> starting at position <num exp>.
  4387.  
  4388.           Examples:
  4389.  
  4390.      1>line='                              '
  4391.      1>customer='John Smith'
  4392.      1>ponumber='32109'
  4393.      1>amount='910.56'
  4394.      1>line=INSERT(line,customer,1)
  4395.      1>? line
  4396.      John Smith
  4397.      1>line=INSERT(line,ponumber,15)
  4398.      1>? line
  4399.      John Smith    32109
  4400.      1>line=INSERT(line,amount,25)
  4401.      1>? line
  4402.      John Smith    32109     910.56
  4403.      1>line='            c                 '
  4404.      1>newline=INSERT(line,customer,@('c',line))
  4405.      1>? newline
  4406.                  John Smith
  4407.  
  4408.           Note: The last example shows the use of INSERT( with "templates".
  4409.      The line variable is the template.  The character "c" in it designates
  4410.      the place where the customer has to be inserted.  Such templates are
  4411.      useful in report generators or for creating screen displays.
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.      INSERT(                    VPI1  VPI  VPIN                     INSERT(
  4424.      VP-Info Level 1 Reference Manual           Page 72           SECTION 3
  4425.  
  4426.  
  4427.  
  4428.                                      LEFT(
  4429.  
  4430.      Gets the left part of a string.
  4431.  
  4432.      ╔════════════════════════════════════════════════════════════════════╗
  4433.      ║ LEFT(<str exp>, <num exp>)                                         ║
  4434.      ║                                                                    ║
  4435.      ║ <str exp>   the string from which the new string is formed         ║
  4436.      ║ <num exp>   the number of characters to place in the new string    ║
  4437.      ╟─────────────────┐                                                  ║
  4438.      ║ Type: character │                                                  ║
  4439.      ╚═════════════════╧══════════════════════════════════════════════════╝
  4440.  
  4441.           This function takes the first <num exp> characters from the
  4442.      string <str exp>.  It is equivalent to, but more efficient than,
  4443.      $(<str exp>, 1, <num exp>).
  4444.  
  4445.           If <num exp> is greater than the width of <str exp>, this
  4446.      function returns all of <str exp>.
  4447.  
  4448.           Wherever an expression calls for a substring starting at the
  4449.      beginning, use LEFT instead of $( or SUBSTR(.
  4450.  
  4451.           Example:
  4452.  
  4453.      1>a='David Bark'
  4454.      1>? LEFT(a,5)
  4455.      David
  4456.      1>? LEFT(a,50)
  4457.      David Bark
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.      LEFT(                      VPI1  VPI  VPIN                       LEFT(
  4481.      VP-Info Level 1 Reference Manual           Page 73           SECTION 3
  4482.  
  4483.  
  4484.  
  4485.                                       LEN(
  4486.  
  4487.      Gets the width (length) of a string.
  4488.  
  4489.      ╔════════════════════════════════════════════════════════════════════╗
  4490.      ║ LEN(<str exp>)                                                     ║
  4491.      ║                                                                    ║
  4492.      ║ <str exp>      the string                                          ║
  4493.      ╟───────────────┐                                                    ║
  4494.      ║ Type: numeric │                                                    ║
  4495.      ╚═══════════════╧════════════════════════════════════════════════════╝
  4496.  
  4497.           This function returns the width (including trailing blanks) of
  4498.      the string <str exp>.
  4499.  
  4500.           Examples:
  4501.  
  4502.      1>name='David Barberr'
  4503.      1>? LEN(name)
  4504.          13.00
  4505.      1>? LEN(name+' is a nice boy')
  4506.          27.00
  4507.  
  4508.           Note that the width of a string is at least 1!
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.      LEN(                       VPI1  VPI  VPIN                        LEN(
  4538.      VP-Info Level 1 Reference Manual           Page 74           SECTION 3
  4539.  
  4540.  
  4541.  
  4542.                                       LOC(
  4543.  
  4544.      Gets the current byte position in a file opened with ROPEN( or WOPEN(.
  4545.  
  4546.      ╔════════════════════════════════════════════════════════════════════╗
  4547.      ║ LOC([<filenum>])                                                   ║
  4548.      ║                                                                    ║
  4549.      ║ Option:                                                            ║
  4550.      ║                                                                    ║
  4551.      ║ <filenum>    the number of the sequential or random file, 1 to 4   ║
  4552.      ║                (default 1)                                         ║
  4553.      ╟─────────────────┐                                                  ║
  4554.      ║ Type: numeric   │                                                  ║
  4555.      ╚═════════════════╧══════════════════════════════════════════════════╝
  4556.  
  4557.           Whenever a file is opened with the ROPEN( or WOPEN( function,
  4558.      VP-Info Level 1 maintains a pointer at a current position, which is
  4559.      where any PUT( or GET( function would take effect.  The position
  4560.      pointer is set with the SEEK( and SSEEK( functions, and reset every
  4561.      time the IN(, OUT, READ(, WRITE(, PUT(, and GET( function is used.
  4562.  
  4563.           If filenum is not given, filenum=1 is assumed.
  4564.  
  4565.           A common use of LOC( is to get the current position before a
  4566.      SEEK( so that the pointer can be reset to the original position after
  4567.      some operation.
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.      LOC(                       VPI1  VPI  VPIN                        LOC(
  4595.      VP-Info Level 1 Reference Manual           Page 75           SECTION 3
  4596.  
  4597.  
  4598.  
  4599.                                      LOWER(
  4600.  
  4601.      Converts a string to lower case.
  4602.  
  4603.      ╔════════════════════════════════════════════════════════════════════╗
  4604.      ║ LOWER(<str exp>)                                                   ║
  4605.      ║                                                                    ║
  4606.      ║ <str exp>        the text to be converted to lower case            ║
  4607.      ╟─────────────────┐                                                  ║
  4608.      ║ Type: character │                                                  ║
  4609.      ╚═════════════════╧══════════════════════════════════════════════════╝
  4610.  
  4611.           All upper-case letters in the <str exp> are converted into lower
  4612.      case by the LOWER( function.  See also the !( and UPPER( functions.
  4613.  
  4614.           Examples:
  4615.  
  4616.      1>a='Aa12b'
  4617.      1>? LOWER(a)
  4618.      aa12b
  4619.      1>? LOWER('David!')
  4620.      david!
  4621.  
  4622.           Note that only the upper-case letters, A-Z, are changed (to a-z).
  4623.      No other characters are affected.
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.      LOWER(                     VPI1  VPI  VPIN                      LOWER(
  4652.      VP-Info Level 1 Reference Manual           Page 76           SECTION 3
  4653.  
  4654.  
  4655.  
  4656.                                      LTRIM(
  4657.  
  4658.      Trims blanks from the left-hand side of a string.
  4659.  
  4660.      ╔════════════════════════════════════════════════════════════════════╗
  4661.      ║ LTRIM(<str exp>)                                                   ║
  4662.      ║                                                                    ║
  4663.      ║ <str exp>        the string to be trimmed                          ║
  4664.      ╟─────────────────┐                                                  ║
  4665.      ║ Type: character │                                                  ║
  4666.      ╚═════════════════╧══════════════════════════════════════════════════╝
  4667.  
  4668.           This function gets rid of the blanks on the left of a string.
  4669.      See also TRIM(.
  4670.  
  4671.           Examples:
  4672.  
  4673.      1>a='    David     '
  4674.      1>? a
  4675.          David
  4676.      1>? LEN(a)
  4677.          14.00
  4678.      1>? LTRIM(a)+' is trimmed on the left'
  4679.      David      is trimmed on the left
  4680.      1>? LEN(LTRIM(a))
  4681.           9.00
  4682.      1>blank='     '
  4683.      1>? LEN(LTRIM(blank))
  4684.           1.00
  4685.  
  4686.           Note: LTRIM(blank) is a single blank.
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.      LTRIM(                     VPI1  VPI  VPIN                      LTRIM(
  4709.      VP-Info Level 1 Reference Manual           Page 77           SECTION 3
  4710.  
  4711.  
  4712.  
  4713.                                  Math Functions
  4714.  
  4715.      Mathematical functions package.
  4716.  
  4717.      ╔════════════════════════════════════════════════════════════════════╗
  4718.      ║ Logarithmic functions:                                             ║
  4719.      ║    EXP(            e-th power                                      ║
  4720.      ║    LOG(            natural logarithmic function                    ║
  4721.      ║    LOG10(          base 10 logarithmic function                    ║
  4722.      ║    POW(            power                                           ║
  4723.      ║    SQRT(           square root                                     ║
  4724.      ║                                                                    ║
  4725.      ║ Trigonometric functions:                                           ║
  4726.      ║    SIN(            sine                                            ║
  4727.      ║    COS(            cosine                                          ║
  4728.      ║    TAN(            tangent                                         ║
  4729.      ║    ASIN(           arc sine                                        ║
  4730.      ║    ACOS(           arc cosine                                      ║
  4731.      ║    ATAN(           arc tangent                                     ║
  4732.      ║                                                                    ║
  4733.      ║ Hyperbolic functions:                                              ║
  4734.      ║    SINH(           hyperbolic sine                                 ║
  4735.      ║    COSH(           hyperbolic cosine                               ║
  4736.      ║    TANH(           hyperbolic tangent                              ║
  4737.      ║                                                                    ║
  4738.      ║ Integer valued functions:                                          ║
  4739.      ║                                                                    ║
  4740.      ║    CEIL(           ceiling integer                                 ║
  4741.      ║    FLOOR(          floor integer                                   ║
  4742.      ║    INT(            integer part                                    ║
  4743.      ║                                                                    ║
  4744.      ║  Real valued functions:                                            ║
  4745.      ║    ABS(            absolute value                                  ║
  4746.      ║    MOD(            modulo value                                    ║
  4747.      ╟───────────────┐                                                    ║
  4748.      ║ Type: numeric │                                                    ║
  4749.      ╚═══════════════╧════════════════════════════════════════════════════╝
  4750.  
  4751.           The mathematical functions are divided into five groups:
  4752.  
  4753.      Logarithmic functions:
  4754.  
  4755.         EXP(<num exp>)               e to the power <num exp>
  4756.         LOG(<num exp>)               natural logarithm of <num exp>
  4757.         LOG10(<num exp>)             base 10 logarithm of <num exp>
  4758.         POW(<num exp1>,<num exp2>)   <num exp1> to the power <num exp2>
  4759.         SQRT(<num exp>)              square root of <num exp>
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.      Math Functions             VPI1  VPI  VPIN              Math Functions
  4766.      VP-Info Level 1 Reference Manual           Page 78           SECTION 3
  4767.  
  4768.  
  4769.      Trigonometric functions:
  4770.  
  4771.         SIN(<num exp>)               sine of <num exp> in radians
  4772.         COS(<num exp>)               cosine of <num exp> in radians
  4773.         TAN(<num exp>)               tangent of <num exp> in radians
  4774.         ASIN(<num exp>)              arc sine of <num exp>; returns a value
  4775.                                         in radians between -π/2 and π/2
  4776.         ACOS(<num exp>)              arc cosine of <num exp>; returns a
  4777.                                         value in radians between 0 and π
  4778.         ATAN(<num exp>)              arc tangent of <num exp>; returns a
  4779.                                         value in radians between -π/2 and
  4780.                                         π/2
  4781.  
  4782.  
  4783.      Hyperbolic functions:
  4784.  
  4785.         SINH(<num exp>)              hyperbolic sine of <num exp>
  4786.         COSH(<num exp>)              hyperbolic cosine of <num exp>
  4787.         TANH(<num exp>)              hyperbolic tangent of <num exp>
  4788.  
  4789.  
  4790.      Integer-valued functions:
  4791.  
  4792.          CEIL(<num exp>)             ceiling integer: the integer equal to
  4793.                                         or just above <num exp>
  4794.          FLOOR(<num exp>)            floor integer: the integer equal to or
  4795.                                         just below <num exp>
  4796.          INT(<num exp>)              the integer part of <num exp> (the
  4797.                                         fractional part is discarded)
  4798.                          Note that for positive numbers, INT( and FLOOR
  4799.                          return the same result, but for negative numbers,
  4800.                          INT( and CEIL( produce the same result.  This is
  4801.                          because discarding the decimal part of a real
  4802.                          number reduces its distance from zero.
  4803.  
  4804.  
  4805.      Real-valued functions:
  4806.  
  4807.          ABS(<num exp>)              absolute value of <num exp>
  4808.          MOD(<num exp1>,<num exp2>)  <num exp1> modulo <num exp1>: returns
  4809.                                         0 if <num exp2> is 0; returns the
  4810.                                         value num with the same sign as
  4811.                                         <num exp1>, less than <num exp2>,
  4812.                                         satisfying
  4813.  
  4814.                                             <num exp1>=i*<num exp2>+num
  4815.  
  4816.                                         for some integer i.
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.      Math Functions             VPI1  VPI  VPIN              Math Functions
  4824.      VP-Info Level 1 Reference Manual           Page 79           SECTION 3
  4825.  
  4826.  
  4827.           Examples:
  4828.  
  4829.      1>:PICTURE='999.999999'
  4830.      1>? EXP(1)
  4831.        2.718282                      this is the value of e
  4832.      1>? LOG(3)
  4833.        1.098612
  4834.      1>? LOG10(3)
  4835.        0.477121
  4836.      1>? POW(2,4)
  4837.       16.000000
  4838.      1>? POW(2,.5)
  4839.        1.414214
  4840.      1>? SQRT(4)
  4841.        2.000000
  4842.      1>? SQRT(2)
  4843.        1.414214
  4844.      1>? SIN(2)                      2 is in radians
  4845.        0.909297
  4846.      1>? ASIN(1)
  4847.        1.570796
  4848.      1>? 2*ASIN(1)
  4849.        3.141593                      this is, of course, π; store this to
  4850.                                         a variable if you need π
  4851.      1>? CEIL(3.14)
  4852.        4.000000
  4853.      1>? FLOOR(3.14)
  4854.        3.000000
  4855.      1>? INT(23.45)
  4856.       23.000000
  4857.      1>? INT(-23.45)
  4858.      -23.000000
  4859.      1>x=23.45
  4860.      1>? INT(10*x)
  4861.      234.000000
  4862.      1>x=23.999
  4863.      1>? INT(x)
  4864.       23.000000
  4865.      1>? INT(3.14)
  4866.        3.000000
  4867.      1>? FLOOR(-3.14)
  4868.       -4.000000
  4869.      1>? INT(-3.14)                  note that for negative numbers, INT(
  4870.       -3.000000                         and FLOOR( give different values
  4871.      1>? MOD(5,2)                    this is the remainder of 5
  4872.        1.000000                         divided by 2
  4873.      1>? MOD(-3.14, .7)
  4874.       -0.340000
  4875.      1>? ABS(-3.14)
  4876.        3.140000
  4877.  
  4878.  
  4879.  
  4880.      Math Functions             VPI1  VPI  VPIN              Math Functions
  4881.      VP-Info Level 1 Reference Manual           Page 80           SECTION 3
  4882.  
  4883.  
  4884.      1>:PICTURE='9999999.99'
  4885.      1>x=15.689
  4886.      1>? INT(x*100+.5)/100      Note: this is how to round to the
  4887.           15.69                        nearest penny
  4888.      1>x=15.244
  4889.      1>? INT(x*100+.5)/100
  4890.           15.24
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.      Math Functions             VPI1  VPI  VPIN              Math Functions
  4938.      VP-Info Level 1 Reference Manual           Page 81           SECTION 3
  4939.  
  4940.  
  4941.  
  4942.                                       MAX(
  4943.  
  4944.      Compare two expressions of any type and return the larger.
  4945.  
  4946.      ╔════════════════════════════════════════════════════════════════════╗
  4947.      ║ MAX(<exp1>,<exp2>)                                                 ║
  4948.      ║                                                                    ║
  4949.      ║ <exp1>    any expression                                           ║
  4950.      ║ <exp2>    any expression of the same type as <exp1                 ║
  4951.      ╟─────────────────────────────────┐                                  ║
  4952.      ║ type: character/numeric/logical │                                  ║
  4953.      ╚═════════════════════════════════╧══════════════════════════════════╝
  4954.  
  4955.           Given any two expressions of the same type, MAX( returns the
  4956.      higher value.  It must be remembered that string comparisons are based
  4957.      on the ASCII value of the characters in the two strings.  Comparing
  4958.      two logical expressions has no meaning.
  4959.  
  4960.           Examples:
  4961.  
  4962.      1>? MAX('hello','goodbye')
  4963.      hello
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.      MAX(                       VPI1  VPI  VPIN                        MAX(
  4995.      VP-Info Level 1 Reference Manual           Page 82           SECTION 3
  4996.  
  4997.  
  4998.  
  4999.                                      MENU(
  5000.  
  5001.      Lightbar menu function; allows point-and-shoot selection from an on-
  5002.      screen menu.
  5003.  
  5004.      ╔════════════════════════════════════════════════════════════════════╗
  5005.      ║ MENU(<choices>,<width>)                                            ║
  5006.      ║                                                                    ║
  5007.      ║ <choices>    the number of choices offered by the menu             ║
  5008.      ║ <width>      the width of the menu lightbar                        ║
  5009.      ╟─────────────────┐                                                  ║
  5010.      ║ Type: numeric   │                                                  ║
  5011.      ╚═════════════════╧══════════════════════════════════════════════════╝
  5012.  
  5013.           The MENU( function pauses program execution and superimposes a
  5014.      movable lightbar (reverse-video line) over a menu of selections
  5015.      previously written to the screen, usually with TEXT.
  5016.  
  5017.           The menu lightbar is moved up and down with the <Up> and <Dn>
  5018.      keys.  If you press <Dn> while on the bottom, the lightbar cycles
  5019.      automatically to the top.  Similarly, pressing <Up> while on the top
  5020.      cycles to the bottom.
  5021.  
  5022.           The user can select any item by moving the lightbar over it and
  5023.      pressing <ENTER>, or entering its line number as a one-digit number.
  5024.      In either case, the line number selected is returned by the function,
  5025.      and the key pressed stored in the system variable :KEY.  Both the
  5026.      function value and :KEY can be tested in a subsequent DO CASE
  5027.      structure to determine the program's next actions.
  5028.  
  5029.           If the user presses 0 or <Home>, MENU( returns zero, although the
  5030.      first line covered by the lightbar is 1.  Options over 9 can be
  5031.      accessed only by the lightbar.
  5032.  
  5033.           If any cursor key except <Up>, <Dn> and <Home> is pressed, MENU(
  5034.      returns the number of the line highlighted by the lightbar, and :KEY
  5035.      contains the key number that would be returned by the INKEY( function.
  5036.      (If SET FUNCTION OFF, all function keys have the same effect as these
  5037.      cursor keys.)
  5038.  
  5039.           While the MENU( function is active, all other typewriter keys are
  5040.      ignored.
  5041.  
  5042.           Examples:
  5043.  
  5044.           1. This is a program which shows specifically the values returned
  5045.      by Menu( when any key is pressed:
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.      MENU(                      VPI1  VPI  VPIN                       MENU(
  5052.      VP-Info Level 1 Reference Manual           Page 83           SECTION 3
  5053.  
  5054.  
  5055.      CLS
  5056.      @ 19,46 say 'Returns'
  5057.      @ 19,64 say ':KEY'
  5058.      DO WHILE t
  5059.         CURSOR 5,20
  5060.         var=MENU(10,20)
  5061.         @ 20,50 say var
  5062.         @ 20,65 say :KEY
  5063.      ENDDO
  5064.  
  5065.           2. In a real-life program:
  5066.  
  5067.      ERASE
  5068.      WINDOW 1,2,23,77 double            ;draw frame around screen
  5069.      @ 1,3 say DATE(full)
  5070.      @ 3,3 say CEN(:company,74)
  5071.      @ 5,3 say CEN('Payroll Menu',74)
  5072.      WINDOW 8,25,22,75 blank            ;use WINDOW to position TEXT
  5073.      TEXT paymenu                       ;menu text in external file
  5074.      WINDOW
  5075.      CURSOR 10,23
  5076.      ans=MENU(8,35)
  5077.      IF ans=0 .or. :key=335
  5078.         CHAIN MENU
  5079.      ENDIF
  5080.      @ ans+9,23 say CHR(16)             ; character as pointer
  5081.      DO CASE
  5082.      CASE ans=1
  5083.         ... etc.
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.      MENU(                      VPI1  VPI  VPIN                       MENU(
  5109.      VP-Info Level 1 Reference Manual           Page 84           SECTION 3
  5110.  
  5111.  
  5112.  
  5113.                                       MIN(
  5114.  
  5115.      Compare two expressions of any type and return the smaller.
  5116.  
  5117.      ╔════════════════════════════════════════════════════════════════════╗
  5118.      ║ MIN(<exp1>,<exp2>)                                                 ║
  5119.      ║                                                                    ║
  5120.      ║ <exp1>    any expression                                           ║
  5121.      ║ <exp2>    any expression of the same type as <exp1>                ║
  5122.      ╟─────────────────────────────────┐                                  ║
  5123.      ║ Type: character/numeric/logical │                                  ║
  5124.      ╚═════════════════════════════════╧══════════════════════════════════╝
  5125.  
  5126.           Given any two expressions of the same type, MIN( returns the
  5127.      lower value.  It must be remembered that string comparisons are based
  5128.      on the ASCII value of the characters in the two strings.  Comparing
  5129.      two logical expressions has no meaning.
  5130.  
  5131.           Examples:
  5132.  
  5133.      1>? MIN('Hello','Goodbye')
  5134.      Goodbye
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.      MIN(                       VPI1  VPI  VPIN                        MIN(
  5166.      VP-Info Level 1 Reference Manual           Page 85           SECTION 3
  5167.  
  5168.  
  5169.  
  5170.                                     MONTHS(
  5171.  
  5172.      Computes date differences in months.
  5173.  
  5174.      ╔════════════════════════════════════════════════════════════════════╗
  5175.      ║ MONTHS(<date1>,<date2>/<num exp>)                                  ║
  5176.      ║                                                                    ║
  5177.      ║ <date1>      a string expression containing a valid date           ║
  5178.      ╟────────────────────────────────────────────────────────────────────╢
  5179.      ║ Options:                                                           ║
  5180.      ║                                                                    ║
  5181.      ║ <date2>      a string expression containing a valid date; when     ║
  5182.      ║                <date2> is specified, MONTHS( returns number of     ║
  5183.      ║                months between the two dates                        ║
  5184.      ║ <num exp>    number of months before or after date1; when          ║
  5185.      ║                specified, MONTHS( returns date that many months    ║
  5186.      ║                away                                                ║
  5187.      ╟──────────────────────────┐                                         ║
  5188.      ║ Type: character/numeric  │                                         ║
  5189.      ╚══════════════════════════╧═════════════════════════════════════════╝
  5190.  
  5191.           MONTHS( computes the difference between the two dates in months,
  5192.      or computes a date a given number of months before or after a
  5193.      specified date.  Fractional parts of months are discarded.
  5194.  
  5195.           If a computed date is after the last date of the month, the date
  5196.      will be adjusted to the last day of the month.  For example,
  5197.      MONTHS('013190',1) results in 022890.
  5198.  
  5199.           Examples:
  5200.  
  5201.      1>? MONTHS('04 06 90','04 29 90')
  5202.            0.00
  5203.      1>? MONTHS('01/01/90','02/01/90')
  5204.            1.00
  5205.      1>? MONTHS('02/01/90','01/01/90')
  5206.           -1.00
  5207.      1>? MONTHS('01/01/90','01/01/92')
  5208.           24.00
  5209.      1>? MONTHS('02/01/90',10)
  5210.      120190
  5211.      1>? MONTHS('01/01/90',-6)
  5212.      070189
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.      MONTHS(                    VPI1  VPI  VPIN                     MONTHS(
  5223.      VP-Info Level 1 Reference Manual           Page 86           SECTION 3
  5224.  
  5225.  
  5226.  
  5227.                                       NDX(
  5228.  
  5229.      Get information on index files in use.
  5230.  
  5231.      ╔════════════════════════════════════════════════════════════════════╗
  5232.      ║ NDX(<type>,<indexnum> [,<filenum>])                                ║
  5233.      ║                                  VP-Info Professional only         ║
  5234.      ║ <type>       the name or number of the information required        ║
  5235.      ║ <indexnum>   the number of the index being checked (1 to 7)        ║
  5236.      ╟────────────────────────────────────────────────────────────────────╢
  5237.      ║ Option:                                                            ║
  5238.      ║                                                                    ║
  5239.      ║ <filenum>    the number of the data file to be checked             ║
  5240.      ╟─────────────────────────┐                                          ║
  5241.      ║ Type: character/logical │                                          ║
  5242.      ╚═════════════════════════╧══════════════════════════════════════════╝
  5243.  
  5244.           NDX( is used to primarily in programs to get the information on
  5245.      the current environment in a form suitable for use in expressions.
  5246.  
  5247.           The <type> can be given in either of two forms, a name or number
  5248.      (numeric expression) as follows:
  5249.  
  5250.           Type           Explanation                         Result     
  5251.  
  5252.           1 or Name      name of index file                   string
  5253.           2 or Key       key on which index was created       string
  5254.           3 or DBF_Name  name of data file on which index
  5255.                            was created                        string
  5256.           4 or Filter    TRUE if filter or FOR clause was
  5257.                           in effect when index was created    logical
  5258.  
  5259.           Shortcut: When specifying type by name, only the first character
  5260.           is required.
  5261.  
  5262.  
  5263.           Examples:
  5264.  
  5265.      1>? NDX(n),NDX(key),NDX(dbf),NDX(filter)
  5266.      CUST1.NDX CUSTNUM  CUSTOMER.DBF F
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.      NDX(                           VPI  VPIN                          NDX(
  5280.      VP-Info Level 1 Reference Manual           Page 87           SECTION 3
  5281.  
  5282.  
  5283.  
  5284.                                     NUMTOC(
  5285.  
  5286.      Convert a decimal number to a hexadecimal string.
  5287.  
  5288.      ╔════════════════════════════════════════════════════════════════════╗
  5289.      ║ NUMTOC(<type>,<number>)                                            ║
  5290.      ║                                  VP-Info Professional only         ║
  5291.      ║ <type>      the length of the string to be created                 ║
  5292.      ║ <number>    the number to be converted                             ║
  5293.      ╟─────────────────┐                                                  ║
  5294.      ║ Type: character │                                                  ║
  5295.      ╚═════════════════╧══════════════════════════════════════════════════╝
  5296.  
  5297.           A general conversion function for converting decimal numbers into
  5298.      hexadecimal values.  Input can be any number, and the returned string
  5299.      length can be up to eight characters as follows:
  5300.  
  5301.           The <type> can be given in either of two forms, a name or number
  5302.      (numeric expression) as follows:
  5303.  
  5304.            Type      Range of Number            String Length Returned
  5305.  
  5306.              1      integer 0 to 255            1 byte
  5307.              2      integer -32768 to 32767     2 bytes
  5308.              4      integer +/- 2 billion       4 bytes
  5309.              8      a floating point number     8 bytes
  5310.  
  5311.           Shortcut: When specifying type by name, only the first character
  5312.           is required.
  5313.  
  5314.           Types 1, 2 and 4 return hexadecimal integers.  Any fractional
  5315.      parts are ignored.
  5316.  
  5317.           When <type> is 1, this function is equivalent to CHR(.  Values
  5318.      outside the range of 0 to 155 return the modulus of 256 for type 1.
  5319.  
  5320.           The CTONUM(, RANK( and ASC( functions convert strings into
  5321.      numbers.
  5322.  
  5323.           Do not confuse these function with STR( and VAL(, which convert
  5324.      decimal numbers into their string representations, and vice versa.
  5325.  
  5326.           Examples:
  5327.  
  5328.      1>? NUMTOC(1,97)
  5329.      a
  5330.      1>? NUMTOC(2,25185)
  5331.      ab
  5332.      1>? NUMTOC(4,6513249)
  5333.  
  5334.  
  5335.  
  5336.      NUMTOC(                        VPI  VPIN                       NUMTOC(
  5337.      VP-Info Level 1 Reference Manual           Page 88           SECTION 3
  5338.  
  5339.  
  5340.      abc
  5341.  
  5342.  
  5343.           Note to users of VP-Info Version 1:
  5344.  
  5345.            Though not in the original Version 1 documentation, a function
  5346.      called CONVERT( was added and documented in a disk file supplied to
  5347.      later purchasers.  This function was broken into two separate
  5348.      functions, CTONUM( and NUMTOC(, in the current version.  Existing
  5349.      programs that use CONVERT( will have to be modified to work as
  5350.      expected under the current versions.
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.  
  5364.  
  5365.  
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.      NUMTOC(                        VPI  VPIN                       NUMTOC(
  5394.      VP-Info Level 1 Reference Manual           Page 89           SECTION 3
  5395.  
  5396.  
  5397.  
  5398.                                       OUT(
  5399.  
  5400.      Outputs a single character to a sequential file.
  5401.  
  5402.      ╔════════════════════════════════════════════════════════════════════╗
  5403.      ║ OUT(<str var> [,<filenum>])                                        ║
  5404.      ║                                                                    ║
  5405.      ║ <str var>      contains the character                              ║
  5406.      ╟────────────────────────────────────────────────────────────────────╢
  5407.      ║ Option:                                                            ║
  5408.      ║                                                                    ║
  5409.      ║ (filenum>      the DOS file number (between 1 and 4)               ║
  5410.      ╟───────────────┐                                                    ║
  5411.      ║ Type: logical │                                                    ║
  5412.      ╚═══════════════╧════════════════════════════════════════════════════╝
  5413.  
  5414.           This function outputs the character in <str var> to the
  5415.      sequential file (opened with the WOPEN( function).
  5416.  
  5417.           If filenum is not given, filenum=1 is assumed.  OUT( returns T if
  5418.      successful, F otherwise.
  5419.  
  5420.           This function is especially useful to communicate over the
  5421.      standard COM1, COM2 devices, for conversion of Word Star or other non-
  5422.      standard files to standard ASCII files, to encrypt/decrypt a file
  5423.      through a translation table.
  5424.  
  5425.           See the functions IN(, ROPEN(, WOPEN(, CLOSE(, SEEK(, SSEEK(,
  5426.      READ(, and WRITE(.
  5427.  
  5428.  
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.      OUT(                       VPI1  VPI  VPIN                        OUT(
  5451.      VP-Info Level 1 Reference Manual           Page 90           SECTION 3
  5452.  
  5453.  
  5454.  
  5455.                                       PIC(
  5456.  
  5457.      Formats a number or string.
  5458.  
  5459.      ╔════════════════════════════════════════════════════════════════════╗
  5460.      ║ PIC(<exp>,<format>)                                                ║
  5461.      ║                                                                    ║
  5462.      ║ <exp>                 is the number or string to be formatted      ║
  5463.      ║ <format>              the format clause                            ║
  5464.      ╟─────────────────┐                                                  ║
  5465.      ║ Type: character │                                                  ║
  5466.      ╚═════════════════╧══════════════════════════════════════════════════╝
  5467.  
  5468.           This function returns the <exp> formatted with the format clause
  5469.      <format>.  See the command @ for the description of the format
  5470.      clauses.  PIC( is especially useful in preparing numeric values for
  5471.      printing.
  5472.  
  5473.           PIC( always returns a string, even when a number or numeric
  5474.      expression is being formatted.
  5475.  
  5476.           Examples:
  5477.  
  5478.      1>number=1123.89
  5479.      1>format='9,999.99'
  5480.      1>? PIC(number,format)
  5481.      1,123.89
  5482.      1>format='9999'
  5483.      1>? PIC(number,format)
  5484.      1123
  5485.      1>format='$$$,$$$.99'
  5486.      1>? PIC(number,format)
  5487.       $1,123.89
  5488.      1>format='$$$,$$$.999'
  5489.      1>? PIC(number,format)
  5490.       $1,123.89
  5491.      1>string='abcd'
  5492.      1>format='xX9!'
  5493.      1>? PIC(string,format)
  5494.      abcd
  5495.      1>format='X-X-X-X'
  5496.      1>? PIC(string,format)
  5497.      a-b-c-d
  5498.      1>SET ZERO ON
  5499.      1> ? 0,'|',str(0,5,2),'|',pic(0,'99.99'),'|','0'
  5500.            0.00 |  0.00 |  0.00 | 0
  5501.      1>SET ZERO OFF
  5502.      1> ? 0,'|',str(0,5,2),'|',pic(0,'99.99'),'|','0'
  5503.                 |  0.00 |       | 0
  5504.  
  5505.  
  5506.  
  5507.      PIC(                       VPI1  VPI  VPIN                        PIC(
  5508.      VP-Info Level 1 Reference Manual           Page 91           SECTION 3
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563.  
  5564.      PIC(                       VPI1  VPI  VPIN                        PIC(
  5565.      VP-Info Level 1 Reference Manual           Page 92           SECTION 3
  5566.  
  5567.  
  5568.  
  5569.                                     PRINTER(
  5570.  
  5571.      Test whether a printer is ready to print.
  5572.  
  5573.      ╔════════════════════════════════════════════════════════════════════╗
  5574.      ║ PRINTER([<printernum>])                                            ║
  5575.      ║                                                                    ║
  5576.      ╟────────────────────────────────────────────────────────────────────╢
  5577.      ║ Option:                                                            ║
  5578.      ║                                                                    ║
  5579.      ║ <printernum>  the number of the LPT port (1 or 2)                  ║
  5580.      ╟─────────────────┐                                                  ║
  5581.      ║ Type: logical   │                                                  ║
  5582.      ╚═════════════════╧══════════════════════════════════════════════════╝
  5583.  
  5584.           Whenever a program has to print, it needs a printer turned on and
  5585.      on-line.  When it is unsuccessful in printing, VP-Info Level 1
  5586.      intercepts the customary DOS error (the infamous "Abort, Retry,
  5587.      Ignore?") and ends execution.
  5588.  
  5589.           The PRINTER( function gives programmers a way to ensure the
  5590.      printer is correctly set up before sending output to the screen.  This
  5591.      makes it possible to suspend execution under program control, prompt
  5592.      for correction action, or even SPOOL the output to a disk file instead
  5593.      of the printer.
  5594.  
  5595.           Examples in programs:
  5596.  
  5597.      DO WHILE .NOT. PRINTER()
  5598.         WINDOW 10,10,15,69 DOUBLE
  5599.         @ 12,10 SAY CEN('Turn on printer and press any key . . .',60)
  5600.         RING
  5601.         CURSOR 13,39
  5602.         cc=INKEY()
  5603.         WINDOW
  5604.      ENDDO
  5605.  
  5606.      IF .NOT. PRINTER(2)                 ;test LPT2
  5607.         SPOOL printfil
  5608.      ENDIF
  5609.  
  5610.      IF PRINTER()
  5611.         SET PRINT ON
  5612.      ENDIF
  5613.  
  5614.  
  5615.  
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.      PRINTER(                   VPI1  VPI  VPIN                    PRINTER(
  5622.      VP-Info Level 1 Reference Manual           Page 93           SECTION 3
  5623.  
  5624.  
  5625.  
  5626.                                       PUT(
  5627.  
  5628.      Puts a string into a DOS file.
  5629.  
  5630.      ╔════════════════════════════════════════════════════════════════════╗
  5631.      ║ PUT(<str exp>[,filenum])                                           ║
  5632.      ║                                                                    ║
  5633.      ║ <str exp>         the string to overwrite with                     ║
  5634.      ╟────────────────────────────────────────────────────────────────────╢
  5635.      ║ Option:                                                            ║
  5636.      ║                                                                    ║
  5637.      ║ <filenum>         the DOS file number (between 1 and 4)            ║
  5638.      ╟───────────────┐                                                    ║
  5639.      ║ Type: logical │                                                    ║
  5640.      ╚═══════════════╧════════════════════════════════════════════════════╝
  5641.  
  5642.           A DOS file was opened with the WOPEN( function; the character
  5643.      number pointer was normally positioned with the SEEK( function.  This
  5644.      function overwrites the file from the character chosen by the
  5645.      character number pointer with the string <str exp>.
  5646.  
  5647.           If filenum is not given, filenum=1 is assumed.  PUT( returns T if
  5648.      successful, F otherwise.
  5649.  
  5650.           See also the functions ROPEN(, WOPEN(, CLOSE(, SEEK(, and GET(.
  5651.  
  5652.           Examples:
  5653.  
  5654.      1>byte=CHR(13)
  5655.      1>ok=WOPEN('test',3)
  5656.      1>ok=SEEK(5221)
  5657.      1>ok=PUT(byte,3)
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.      PUT(                       VPI1  VPI  VPIN                        PUT(
  5679.      VP-Info Level 1 Reference Manual           Page 94           SECTION 3
  5680.  
  5681.  
  5682.  
  5683.                                      RAND(
  5684.  
  5685.      Gives a random number in the range 0<=n<1.
  5686.  
  5687.      ╔════════════════════════════════════════════════════════════════════╗
  5688.      ║ RAND([<seed>])                                                     ║
  5689.      ╟────────────────────────────────────────────────────────────────────╢
  5690.      ║ Option:                                                            ║
  5691.      ║                                                                    ║
  5692.      ║ <seed>    a number used to initiate the random series              ║
  5693.      ╟─────────────────┐                                                  ║
  5694.      ║ Type: numeric   │                                                  ║
  5695.      ╚═════════════════╧══════════════════════════════════════════════════╝
  5696.  
  5697.           A series of successive calls to the RAND( function will return a
  5698.      uniform distribution of random numbers.
  5699.  
  5700.           The first time RAND( is called, <seed> -- any numeric expression
  5701.      -- may be specified. All subsequent calls should be without the seed.
  5702.      If no initial seed is provided, a random seed is chosen by the
  5703.      program.
  5704.  
  5705.           RAND( always returns a number equal to or greater than 0 and less
  5706.      than 1.  If you need a random series of integers between zero and
  5707.      5000, use 5000*RAND().
  5708.  
  5709.           Note: if you provide the initial seed, every execution of RAND()
  5710.      will return the same series of numbers.
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.      RAND(                    VPI1  VPI  VPIN                         RAND(
  5736.      VP-Info Level 1 Reference Manual           Page 95           SECTION 3
  5737.  
  5738.  
  5739.  
  5740.                                      RANK(
  5741.  
  5742.      Converts a character to its ASCII number.
  5743.  
  5744.      ╔════════════════════════════════════════════════════════════════════╗
  5745.      ║ RANK(<str exp>)                                                    ║
  5746.      ║                                                                    ║
  5747.      ║ <str exp>      the first character of this string is converted     ║
  5748.      ╟───────────────┐                                                    ║
  5749.      ║ Type: numeric │                                                    ║
  5750.      ╚═══════════════╧════════════════════════════════════════════════════╝
  5751.  
  5752.           The characters in the character set used by the computer are
  5753.      numbered from 0 to 255.  For the first character of the string
  5754.      <str exp>, RANK( returns the corresponding number.  See also the
  5755.      function CHR(.  See also the functions CHR(, CTONUM(, and NUMTOC(.
  5756.  
  5757.           Examples:
  5758.  
  5759.      1>? RANK('x')
  5760.         120.00
  5761.      1>? RANK('xyz')
  5762.         120.00
  5763.  
  5764.           Note that only the first character of the string matters.
  5765.  
  5766.  
  5767.  
  5768.  
  5769.  
  5770.  
  5771.  
  5772.  
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.      RANK(                      VPI1  VPI  VPIN                       RANK(
  5793.      VP-Info Level 1 Reference Manual           Page 96           SECTION 3
  5794.  
  5795.  
  5796.  
  5797.                                      READ(
  5798.  
  5799.      Reads a line of a sequential file.
  5800.  
  5801.      ╔════════════════════════════════════════════════════════════════════╗
  5802.      ║ READ(<str var>[,<filenum>])                                        ║
  5803.      ║                                                                    ║
  5804.      ║ <str var>      stores the line read in                             ║
  5805.      ╟────────────────────────────────────────────────────────────────────╢
  5806.      ║ Option:                                                            ║
  5807.      ║                                                                    ║
  5808.      ║ <filenum>      the DOS file number (between 1 and 4)               ║
  5809.      ╟───────────────┐                                                    ║
  5810.      ║ Type: logical │                                                    ║
  5811.      ╚═══════════════╧════════════════════════════════════════════════════╝
  5812.  
  5813.           This function reads the next line of the sequential file (opened
  5814.      with the ROPEN( function) into the string variable <str var>.  If
  5815.      <str var> does not exist, it will be created;  <str var> cannot be a
  5816.      matrix variable.
  5817.  
  5818.           A line is terminated by the carriage return character (ASCII 13).
  5819.      Since the line is read into a string variable, it cannot be longer
  5820.      than 254 characters.
  5821.  
  5822.           If filenum is not given, filenum=1 is assumed.  READ( returns T
  5823.      if successful, F otherwise.
  5824.  
  5825.           In VP-Info Level 1 programs, READ( normally appears in an IF or
  5826.      DO WHILE command.
  5827.  
  5828.           READ(, IN(, GET(, and WRAP( are the only functions that change
  5829.      the contents of the memory variable used as an argument.
  5830.  
  5831.           See Programming VP-Info Level 1 for sequential file handling and
  5832.      examples, and++ the functions WRITE(, ROPEN(, WOPEN(, CLOSE(, IN(,
  5833.      OUT(, and SSEEK(.
  5834.  
  5835.           Examples:
  5836.  
  5837.           1. In Conversational VP-Info Level 1:
  5838.  
  5839.      1>ok=ROPEN('a:label.prg')
  5840.      1>ok=READ(line)
  5841.      1>? line
  5842.  
  5843.           2. Two programs to print a text file, TEST (in the second version
  5844.      it is assumed that TEST has no more than 20 lines):
  5845.  
  5846.  
  5847.  
  5848.  
  5849.      READ(                      VPI1  VPI  VPIN                       READ(
  5850.      VP-Info Level 1 Reference Manual           Page 97           SECTION 3
  5851.  
  5852.  
  5853.      SET WIDTH TO 80
  5854.      SET PRINT ON
  5855.      IF ROPEN('test')
  5856.         DO WHILE READ(line)
  5857.            ? line
  5858.         ENDDO
  5859.         ok=CLOSE()
  5860.      ENDIF
  5861.  
  5862.      DIM CHAR 80 matrix[20]
  5863.      SET WIDTH TO 80
  5864.      SET PRINT ON
  5865.      IF ROPEN('test',1)
  5866.         REPEAT 20 times VARYING num
  5867.            IF READ(input,1)
  5868.               matrix[num]=input,
  5869.            ELSE
  5870.               BREAK
  5871.            ENDIF
  5872.         ENDREPEAT
  5873.         IF CLOSE(1)
  5874.            ? matrix
  5875.         ENDIF
  5876.      ENDIF
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.      READ(                      VPI1  VPI  VPIN                       READ(
  5907.      VP-Info Level 1 Reference Manual           Page 98           SECTION 3
  5908.  
  5909.  
  5910.  
  5911.                                      RECNO(
  5912.  
  5913.      Gets the current record number in any open data file.
  5914.  
  5915.      ╔════════════════════════════════════════════════════════════════════╗
  5916.      ║ RECNO([<filenum>])                                                 ║
  5917.      ║                                                                    ║
  5918.      ╟────────────────────────────────────────────────────────────────────╢
  5919.      ║ Option:                                                            ║
  5920.      ║                                                                    ║
  5921.      ║ <filenum>    the number of any open data file; default is the      ║
  5922.      ║                selected data file                                  ║
  5923.      ╟───────────────┐                                                    ║
  5924.      ║ Type: numeric │                                                    ║
  5925.      ╚═══════════════╧════════════════════════════════════════════════════╝
  5926.  
  5927.           This function returns the record number of the current record of
  5928.      any specified data file; if no <filenum> is given, returns the record
  5929.      number the selected file.  Note that ? RECNO() displays the current
  5930.      record number in the form specified by the system variable :PICTURE
  5931.      (see Section 2.7).
  5932.  
  5933.           VP-Info Level 1 also has a more limited form of this function,
  5934.      RECNO(, which applies only to the selected data file.
  5935.  
  5936.           Examples:
  5937.  
  5938.      1>USE employee
  5939.      1>USE#2 customer
  5940.      1>? RECNO(1)
  5941.           1.00
  5942.      1>GO BOTTOM
  5943.      1>? RECNO(1)
  5944.           6.00
  5945.      1>GO TOP
  5946.      1>? RECNO()
  5947.           1.00
  5948.      1>SKIP#2 2
  5949.      1>? RECNO(2)
  5950.           3.00
  5951.  
  5952.  
  5953.  
  5954.  
  5955.  
  5956.  
  5957.  
  5958.  
  5959.  
  5960.  
  5961.  
  5962.  
  5963.      RECNO(                     VPI1  VPI  VPIN                      RECNO(
  5964.      VP-Info Level 1 Reference Manual           Page 99           SECTION 3
  5965.  
  5966.  
  5967.  
  5968.                                     REMLIB(
  5969.  
  5970.      Removes a library entry.
  5971.  
  5972.      ╔════════════════════════════════════════════════════════════════════╗
  5973.      ║ REMLIB(<volume>)                                                   ║
  5974.      ║                                                                    ║
  5975.      ║ <volume>        the number of the library entry to be removed.     ║
  5976.      ╟─────────────────┐                                                  ║
  5977.      ║ Type: logical   │                                                  ║
  5978.      ╚═════════════════╧══════════════════════════════════════════════════╝
  5979.  
  5980.           This function deletes a library entry.  The function accepts the
  5981.      library volume number you wish to delete as its argument and returns T
  5982.      (true) if the delete operation was successful, F (false) if not.
  5983.  
  5984.           Once a library entry (volume) is deleted, its space in the
  5985.      library is made available for new text.
  5986.  
  5987.           Libraries are created with the SET LIBRARY TO command. See TEXT
  5988.      and WRITE commands.
  5989.  
  5990.           Example:
  5991.  
  5992.      1>? REMLIB(50)
  5993.      T
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.      REMLIB(                    VPI1  VPI  VPIN                     REMLIB(
  6021.      VP-Info Level 1 Reference Manual           Page 100          SECTION 3
  6022.  
  6023.  
  6024.  
  6025.                                     REPLACE(
  6026.  
  6027.      Replaces, in a string expression, all occurrences of a string with
  6028.      another string.
  6029.  
  6030.      ╔════════════════════════════════════════════════════════════════════╗
  6031.      ║ REPLACE(<str exp>,<str exp1>,<str exp2>)                           ║
  6032.      ║                                                                    ║
  6033.      ║ <str exp>      replace in this string expression                   ║
  6034.      ║ <str exp1>     all occurrences of this string                      ║
  6035.      ║ <str exp2>     with this string                                    ║
  6036.      ╟─────────────────┐                                                  ║
  6037.      ║ Type: character │                                                  ║
  6038.      ╚═════════════════╧══════════════════════════════════════════════════╝
  6039.  
  6040.           This function looks up the first occurrence of <str exp1> in the
  6041.      string <str exp>.  This occurrence is replaced with <str exp2>.  This
  6042.      process continues as long as <str exp1> occurs in <str exp>.
  6043.  
  6044.           Examples:
  6045.  
  6046.           1. A field contains a number as right justified characters,
  6047.      padded on the left with blanks.  The following REPLACE( changes these
  6048.      numbers to right justified numbers padded on the left with zeros.
  6049.  
  6050.      1>number='     123'
  6051.      1>number=REPLACE(number,' ','0')
  6052.      1>? number
  6053.      00000123
  6054.  
  6055.           2. In writing checks, dollar amounts may be left padded with
  6056.      dollar signs:
  6057.  
  6058.      1>number='     123.11'
  6059.      1>number=REPLACE(number,' ','$')
  6060.      1>? number
  6061.      $$$$$123.11
  6062.  
  6063.           3. Renaming a variable in a program line.  The variable OLDN is
  6064.      renamed FIRSTNUMB.
  6065.  
  6066.      1>line='newn=oldn+oldn+(oldn/3)'
  6067.      1>line=REPLACE(line,'oldn','firstnumb')
  6068.      1>? line
  6069.      newn=firstnumb+firstnumb+(firstnumb/3)
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.      REPLACE(                   VPI1  VPI  VPIN                    REPLACE(
  6078.      VP-Info Level 1 Reference Manual           Page 101          SECTION 3
  6079.  
  6080.  
  6081.  
  6082.                                      RESET(
  6083.  
  6084.      Sets a bit in a string to 0.
  6085.  
  6086.      ╔════════════════════════════════════════════════════════════════════╗
  6087.      ║ RESET(<str exp>,<bit position>)                                    ║
  6088.      ║                                                                    ║
  6089.      ║ <str exp>       the string or string expression on which the       ║
  6090.      ║                   function is to act                               ║
  6091.      ║ <bit position>  the number of the bit, numbered from the left      ║
  6092.      ║                   starting at 1, which is to be set to zero        ║
  6093.      ╟───────────────┐                                                    ║
  6094.      ║ Type: logical │                                                    ║
  6095.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6096.  
  6097.           A bit is any of the eight binary digits in a character's ASCII
  6098.      number representation.  Each bit can have only one of two possible
  6099.      values, 0 and 1.
  6100.  
  6101.           The SET( and RESET( functions are used to manipulate the bits
  6102.      within a string or string expression.  SET( makes a bit 1, and RESET(
  6103.      makes a bit 0.  The BIT( function tests the value of a specific bit.
  6104.  
  6105.           Among the chief uses for these functions is compression of
  6106.      logical (true/false) data by using just one bit for each data item
  6107.      instead of an entire byte for a logical field or two bytes for a
  6108.      logical variable.
  6109.  
  6110.           See the BIT( function for programming examples.
  6111.  
  6112.           Examples:
  6113.  
  6114.      1>str='PS'
  6115.      1>? BIT(str,15)
  6116.      T
  6117.      1>str=RESET(str,15)
  6118.      1>? str,BIT(str,15)
  6119.      PQ F
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.      RESET(                     VPI1  VPI  VPIN                      RESET(
  6135.      VP-Info Level 1 Reference Manual           Page 102          SECTION 3
  6136.  
  6137.  
  6138.  
  6139.                                      RIGHT(
  6140.  
  6141.      Gets the right-hand part of a string.
  6142.  
  6143.      ╔════════════════════════════════════════════════════════════════════╗
  6144.      ║ RIGHT(<str exp>, <num exp>)                                        ║
  6145.      ║                                                                    ║
  6146.      ║ <str exp>   the string from which the new string is formed         ║
  6147.      ║ <num exp>   the number of characters to place in the new string    ║
  6148.      ╟─────────────────┐                                                  ║
  6149.      ║ Type: character │                                                  ║
  6150.      ╚═════════════════╧══════════════════════════════════════════════════╝
  6151.  
  6152.           This function returns the last (that is, the rightmost) <num exp>
  6153.      characters from the string <str exp>.
  6154.  
  6155.           If <num exp> is greater than the width of <str exp>, this
  6156.      function returns all of <str exp>.
  6157.  
  6158.           Example:
  6159.  
  6160.      1>a='David Bark'
  6161.      1>? RIGHT(a,5)
  6162.       Bark
  6163.      1>? RIGHT(a,50)
  6164.      David Bark
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.  
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.      RIGHT(                     VPI1  VPI  VPIN                      RIGHT(
  6192.      VP-Info Level 1 Reference Manual           Page 103          SECTION 3
  6193.  
  6194.  
  6195.  
  6196.                                      ROPEN(
  6197.  
  6198.      Opens a DOS file for reading.
  6199.  
  6200.      ╔════════════════════════════════════════════════════════════════════╗
  6201.      ║ ROPEN(<str exp> [,filenum])                                        ║
  6202.      ║                                                                    ║
  6203.      ║ <str exp>      the file name                                       ║
  6204.      ╟────────────────────────────────────────────────────────────────────╢
  6205.      ║ Option:                                                            ║
  6206.      ║                                                                    ║
  6207.      ║ filenum        the DOS file number (between 1 and 4)               ║
  6208.      ╟───────────────┐                                                    ║
  6209.      ║ Type: logical │                                                    ║
  6210.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6211.  
  6212.           This function opens <str exp>, a DOS file (in particular, a
  6213.      sequential file or input device, such as COM1), for reading only.  The
  6214.      current position pointer (see the SEEK( function) is set to the
  6215.      beginning of the file.
  6216.  
  6217.           If filenum is not given, filenum=1 is assumed.  If no file
  6218.      extension is given, the extension TXT is used.
  6219.  
  6220.           ROPEN( returns T if successful, F otherwise.
  6221.  
  6222.           See the functions WOPEN(, CLOSE(, READ(, WRITE(, IN(, OUT(, GET(,
  6223.      PUT(, SEEK(, and SSEEK(.
  6224.  
  6225.           Examples:
  6226.  
  6227.      1>? ROPEN('a:label.prg')
  6228.      T
  6229.  
  6230.           In a VP-Info Level 1 program, ROPEN( normally appears in an IF
  6231.      command:
  6232.  
  6233.      IF ROPEN('file',2)
  6234.         DO WHILE READ(data,2)
  6235.            ? data
  6236.         ENDDO
  6237.         ok=CLOSE(2)
  6238.      ENDIF
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.  
  6247.  
  6248.      ROPEN(                     VPI1  VPI  VPIN                      ROPEN(
  6249.      VP-Info Level 1 Reference Manual           Page 104          SECTION 3
  6250.  
  6251.  
  6252.  
  6253.                                       ROW(
  6254.  
  6255.      Gets print row position.
  6256.  
  6257.      ╔════════════════════════════════════════════════════════════════════╗
  6258.      ║ ROW()                                                              ║
  6259.      ╟───────────────┐                                                    ║
  6260.      ║ Type: numeric │                                                    ║
  6261.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6262.  
  6263.           This function gives the current row (line) position of the
  6264.      cursor; if the printer is on, it returns the column position of the
  6265.      printer head.  See the commands SET PRINT ON and SET FORMAT TO PRINT,
  6266.      and the function COL(.
  6267.  
  6268.           Example:
  6269.  
  6270.      @ ROW()+1,COL()+3 SAY 'Hello'
  6271.  
  6272.      prints 'Hello' starting on the next line three characters to the right
  6273.      of the end of the last printing.
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.  
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  
  6297.  
  6298.  
  6299.  
  6300.  
  6301.  
  6302.  
  6303.  
  6304.  
  6305.      ROW(                       VPI1  VPI  VPIN                        ROW(
  6306.      VP-Info Level 1 Reference Manual           Page 105          SECTION 3
  6307.  
  6308.  
  6309.  
  6310.                                      SEEK(
  6311.  
  6312.      Goes to a given character number in a DOS file.
  6313.  
  6314.      ╔════════════════════════════════════════════════════════════════════╗
  6315.      ║ SEEK(<num exp> [,filenum])                                         ║
  6316.      ║                                                                    ║
  6317.      ║ <num exp>      the character number                                ║
  6318.      ╟────────────────────────────────────────────────────────────────────╢
  6319.      ║ Option:                                                            ║
  6320.      ║                                                                    ║
  6321.      ║ <filenum>      the DOS file number (between 1 and 4)               ║
  6322.      ╟───────────────┐                                                    ║
  6323.      ║ Type: logical │                                                    ║
  6324.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6325.  
  6326.           This function repositions the character number pointer in the DOS
  6327.      file (opened with the ROPEN( or WOPEN( function) to the value given by
  6328.      <num exp>.
  6329.  
  6330.           If filenum is not given, filenum=1 is assumed.  If no file
  6331.      extension is given, the extension TXT is used.
  6332.  
  6333.           If SEEK( is successful, it returns T (true); otherwise F (false).
  6334.      In a VP-Info Level 1 program, SEEK( normally occurs in an IF or DO
  6335.      WHILE command.
  6336.  
  6337.           Once the character pointer is properly positioned, use the GET(
  6338.      and PUT( functions to manipulate the characters.
  6339.  
  6340.           See the functions SSEEK(, ROPEN(, WOPEN(, CLOSE(, GET(, and PUT(.
  6341.  
  6342.           Example:
  6343.  
  6344.      1>ok=ROPEN('a:label.prg',4)
  6345.      1>ok=SEEK(522,4)
  6346.  
  6347.  
  6348.  
  6349.  
  6350.  
  6351.  
  6352.  
  6353.  
  6354.  
  6355.  
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.      SEEK(                      VPI1  VPI  VPIN                       SEEK(
  6363.      VP-Info Level 1 Reference Manual           Page 106          SECTION 3
  6364.  
  6365.  
  6366.  
  6367.                                       SET(
  6368.  
  6369.      Sets a bit in a string to 1.
  6370.  
  6371.      ╔════════════════════════════════════════════════════════════════════╗
  6372.      ║ SET(<str exp>,<bit position>)                                      ║
  6373.      ║                                                                    ║
  6374.      ║ <str exp>       the string or string expression on which the       ║
  6375.      ║                   function is to act                               ║
  6376.      ║ <bit position>  the number of the bit, numbered from the left      ║
  6377.      ║                   starting at 1, which is to be set to 1           ║
  6378.      ╟───────────────┐                                                    ║
  6379.      ║ Type: logical │                                                    ║
  6380.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6381.  
  6382.           A bit is any of the eight binary digits in a character's ASCII
  6383.      number representation.  Each bit can have only one of two possible
  6384.      values, 0 and 1.
  6385.  
  6386.           The SET( and RESET( functions are used to manipulate the bits
  6387.      within a string or string expression.  SET( makes a bit 1, and RESET(
  6388.      makes a bit 0.  The BIT( function tests the value of a specific bit.
  6389.  
  6390.           Among the chief uses for these functions is compression of
  6391.      logical (true/false) data by using just one bit for each data item
  6392.      instead of an entire byte for a logical field or two bytes for a
  6393.      logical variable.
  6394.  
  6395.           See the BIT( function for programming examples.
  6396.  
  6397.           Examples:
  6398.  
  6399.      1>str='PQ'
  6400.      1>? BIT(str,15)
  6401.      F
  6402.      1>str=RESET(str,15)
  6403.      1>? str,BIT(str,15)
  6404.      PS T
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.  
  6416.  
  6417.  
  6418.  
  6419.      SET(                       VPI1  VPI  VPIN                        SET(
  6420.      VP-Info Level 1 Reference Manual           Page 107          SECTION 3
  6421.  
  6422.  
  6423.  
  6424.                                      SPACE(
  6425.  
  6426.      Gets the amount of space left in the data space.
  6427.  
  6428.      ╔════════════════════════════════════════════════════════════════════╗
  6429.      ║ SPACE()                                                            ║
  6430.      ╟───────────────┐                                                    ║
  6431.      ║ Type: numeric │                                                    ║
  6432.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6433.  
  6434.           This function returns the available memory in the 64K data space
  6435.      (see Appendix A).
  6436.  
  6437.           Example:
  6438.  
  6439.      1>SPACE()
  6440.       27155.00
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.      SPACE(                     VPI1  VPI  VPIN                      SPACE(
  6477.      VP-Info Level 1 Reference Manual           Page 108          SECTION 3
  6478.  
  6479.  
  6480.  
  6481.                                      SSEEK(
  6482.  
  6483.      Goes to a given line number in a sequential file.
  6484.  
  6485.      ╔════════════════════════════════════════════════════════════════════╗
  6486.      ║ SSEEK(<num exp> [,<filenum>])                                      ║
  6487.      ║                                                                    ║
  6488.      ║ <num exp>      the line number                                     ║
  6489.      ╟────────────────────────────────────────────────────────────────────╢
  6490.      ║ Option:                                                            ║
  6491.      ║                                                                    ║
  6492.      ║ <filenum>      the DOS file number (between 1 and 4)               ║
  6493.      ╟───────────────┐                                                    ║
  6494.      ║ Type: logical │                                                    ║
  6495.      ╚═══════════════╧════════════════════════════════════════════════════╝
  6496.  
  6497.           This function repositions the line number pointer in the
  6498.      sequential file (opened with the ROPEN( function) to the value given
  6499.      by <num exp>.
  6500.  
  6501.           If filenum is not given, filenum=1 is assumed.  If no file
  6502.      extension is given, the extension TXT is used.
  6503.  
  6504.           If filenum is not given, filenum=1 is assumed.  If no file
  6505.      extension is given, the extension TXT is used.
  6506.  
  6507.           See the functions SEEK(, ROPEN(, WOPEN(, CLOSE(, READ(,  IN(, and
  6508.      OUT(.
  6509.  
  6510.           Example:
  6511.  
  6512.      1>ok=ROPEN('a:label.prg',4)
  6513.      1>line=''
  6514.      1>ok=SSEEK(5,4)
  6515.      1>? ok
  6516.      T
  6517.      1>ok=READ(line,4)
  6518.      1>? line
  6519.      GOTO top
  6520.      1>ok=SSEEK(900,4)
  6521.      1>? ok
  6522.      F
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.      SSEEK(                     VPI1  VPI  VPIN                      SSEEK(
  6534.